vue 监听数组长度变化
1 | var vm = new Vue({ |
vue 监听对象变化
1 | var vm = new Vue({ |
错误处理
renderError
1 | new Vue({ |
errorCaptured
1 | Vue.component('error-boundary', { |
errorHandler & warnHandler
1 | Vue.config.errHandler = function (err, vm, info) { |
window.onerror
1 | window.onerror = function (msg, source, line, column, error) { |
减少重复
重复代码:
1 | data () { |
使用computed
减少重复:
1 | computed: { |
重复代码:
1 | created () { |
使用immediate watcher
减少重复:
1 | watch: { |