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
var kinds = [{ "id": "1", }, { "id": "2", }, { "id": "3", }, { "id": "4", }] var Click = function() { console.log("hello wsscat") } var demo = new Vue({ el: '#demo', data: { kinds, }, methods: { Click, } })
上面我们把需要复用的方法和数据在Vue构造器外部并之前定义,就可以达到在每个Vue()里面复用
<ul> <li v-for="kind in kinds"> {{kind.id}} </li> </ul> <button @click="Click()">Wsscat</button>
这种就相当于angular定义的服务可以复用数据和方法
The text was updated successfully, but these errors were encountered:
No branches or pull requests
上面我们把需要复用的方法和数据在Vue构造器外部并之前定义,就可以达到在每个Vue()里面复用
这种就相当于angular定义的服务可以复用数据和方法
The text was updated successfully, but these errors were encountered: