Table of Contents
1. Functional programming
1. Introduction to functional programming
2. Code examples
2. v-model
1. v-model two-way binding
2, v-model and radio are used together
3, v-model and CheckBox radio button are used together
4. Use v-model in combination with CheckBox multi-select box
Components are an important idea in Vue.js
4、组件化语法糖写法
5、组件模板抽离写法
四、组件可以访问Vue实例数据吗?
1、简介
2、代码实例
3、效果展示 
五、父子组件通信
1、父子组件通信简介
2、父传子代码实例
3、父传子效果展示 
4、props中的驼峰标识
5、子传父(自定义事件方式)
6、子传父代码实例
7、子传父效果展示
Home Web Front-end Vue.js Summary of Vue basic knowledge: Vue component development

Summary of Vue basic knowledge: Vue component development

Aug 10, 2022 am 09:56 AM
vue

This article brings you about vue It mainly introduces issues related to vue component development. Component development provides an abstraction. We can develop an independent and reusable We use small components to construct our application components. Let’s take a look at them. I hope it will be helpful to everyone.

Summary of Vue basic knowledge: Vue component development

[Related recommendations: javascript video tutorial, web front-end

1. Functional programming

1. Introduction to functional programming

Functional programming is a programming method that treats computer operations as calculations of functions. The most important foundation of functional programming language is lambda calculus, and lambda calculus functions can accept functions as input (parameters) and output (return values).

Compared with imperative programming, functional programming emphasizes that the calculation of functions is more important than the execution of instructions.

Compared with procedural programming, function calculations in functional programming can be called at any time.

The filter function automatically filters all elements of the object, and returns true before it is stored in the specified object;

The Reduce function summarizes all elements inside the array;

2. Code examples

<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
<div id="app">
  {{totalPrice()}}
</div>
 
<script src="../js/vue.js"></script>
<script>
  const app = new Vue({
    el: '#app',
    data: {
      message: '你好'
    },
    methods :{
      totalPrice(){
        const nums = [10,9,21,16,7]
        let total = nums.filter(x => x<10).map(x => x*2).reduce((pre,n)=>pre+n);
        console.log(total)
        return total
      }
    }
  })
</script>
</body>
</html>
Copy after login

2. v-model

Form elements such as and