Skip to content
New issue

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

单文件组件中v-model使用 #1

Open
mogocat opened this issue Mar 16, 2017 · 1 comment
Open

单文件组件中v-model使用 #1

mogocat opened this issue Mar 16, 2017 · 1 comment

Comments

@mogocat
Copy link

mogocat commented Mar 16, 2017

怎么在其他vue文件中引用到定义好的model呢?有示例吗?

@laoshu133
Copy link
Member

当作一个普通的模块引入就好了,例如:

// post-model.js
import Model from 'v-model';

export default Model.extend('/posts');
import PostModel from './post-model';

PostModel.save(...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants