Comments (10)
怎么直接集成,能把代码发出来吗?
from model.
{{ msg }}
{{a}} {{a.b}}import Model from "js-model";
export default new Model({
a: {
b: {
c: Number
},
d: String
},
})
我这样输出a是一个对象,但是a.b就是undefined
from model.
import Model from "js-model";
export default new Model({
a: {
b: {
c: Number
},
d: String
},
})
<template>
<div class="hello">
<h1>{{ msg }}</h1>
{{a}}
<hr>
</div>
</template>
<script>
import Test1 from './../model/Test1.js';
let a = Test1.parse({});
console.log(a.b);
export default {
name: 'HelloWorld',
data () {
return {
msg: 'Welcome to Your Vue.js App',
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
</style>
我这样输出a是一个对象,但是a.b就是undefined
from model.
<template>
<div class="hello">
<h1>{{ msg }}</h1>
{{a}}
<hr>
</div>
</template>
<script>
import Test1 from './../model/Test1.js';
export default {
name: 'HelloWorld',
data () {
return {
a: Test1.parse({}),
msg: 'Welcome to Your Vue.js App',
}
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
</style>
我写的是伪代码,你也不用用的这么直接啊?
from model.
知道是伪代码,我也是看到这个东西比较好,尝试下,今后用在项目中,能发下你使用的代码出来看下吗
from model.
你按照上面的代码就可以了,你也可以等等,我整理一个vue的使用基础sample,下午发出来。
from model.
不可以,是不是还要在哪里配置,我最近打算把数据层与视图层分开,等待sample
from model.
https://codepen.io/vvpvvp/pen/jpEjwW
我可以说,我自己把自己给蠢死的吗?😂😂😂😂😂
其实demo里面定义完是 a.a ,a.a.b.c, a.a.d,写文章的时候把自己给绕进去了。😭😭😭😭
from model.
我看了下,好像用途不是很大,依然要去判断,不是跟你掘金上说的,不需要判断,方便加你好友再研究下吗
from model.
聊天室:https://discord.gg/VUZbFmd
或者你把微信号发给我
from model.
Related Issues (10)
- parse 数据可以是定义吗 HOT 1
- 哈喽,我想问一下为啥要定义自己的一套TYPE HOT 2
- pkg.json homepage value is wrong? HOT 1
- 请问数组怎么设置默认值? HOT 1
- parse 结果是 [object Object] HOT 3
- How to parse array HOT 1
- 可以支持typescript吗 HOT 2
- 是否可以加入转义读取key的功能? HOT 3
- type: Array, parse 返回异常
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from model.