自定义函数全部写在methods中:
export default { methods: { coustom() { } } }
计算属性和侦听器
export default { data() { return { name: '张三' }; }, computed: { helloName() { return 'hello' + this.name; } }, watch: { name(now, old) { console.log(now, old); } } }
自定义函数全部写在methods中:
export default { methods: { coustom() { } } }
计算属性和侦听器
export default { data() { return { name: '张三' }; }, computed: { helloName() { return 'hello' + this.name; } }, watch: { name(now, old) { console.log(now, old); } } }