We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
//全局 注册 Vue.filter('my-filter', function (value) { // 返回处理后的值 }) //组件 注册 new Vue({ // ... filters: { fillLogoSrc: function (value) { } } }) //使用 <img :src="item.logo | fillLogoSrc" alt="">
Vue Devtools
Vue.component(tagName, options)
beforeCreate -> created(在这里进行初始化操作,调用方法或请求api) -> beforeMount -> mounted -> (beforeUpdate -> updated) -> beforeDestory -> destoryed
组件的state是组件自身缓存的数据,用this.state=进行修改 props是父组件传递下来的数据,子组件无法进行修改 store.state是store中存储的状态,可以修改,通过调用store的mutation进行修改
父组件->子组件:props传递数据,子组件watch props进行监听,或者通过监听store的state改变 子组件->父组件:自定义事件,父组件用v-on绑定自定义事件,子组件通过this.$emit('increment')进行触发;父组件的props传递function,子组件进行调用;通过监听store的state改变
The text was updated successfully, but these errors were encountered:
No branches or pull requests
过滤器fitler 如何使用
调试
Vue Devtools
注册组件
组件的生命周期
beforeCreate -> created(在这里进行初始化操作,调用方法或请求api) -> beforeMount -> mounted -> (beforeUpdate -> updated) -> beforeDestory -> destoryed
组件的data、props和store.state有什么区别,是否可修改,如何修改
组件的state是组件自身缓存的数据,用this.state=进行修改
props是父组件传递下来的数据,子组件无法进行修改
store.state是store中存储的状态,可以修改,通过调用store的mutation进行修改
父组件和子组件之间通信
父组件->子组件:props传递数据,子组件watch props进行监听,或者通过监听store的state改变
子组件->父组件:自定义事件,父组件用v-on绑定自定义事件,子组件通过this.$emit('increment')进行触发;父组件的props传递function,子组件进行调用;通过监听store的state改变
The text was updated successfully, but these errors were encountered: