Comments (12)
剥离数据在开发计划中,但是要求参数格式和目前的统一。
from vux.
异步取数据写在data钩子里,然后为组件加上v-if="!$loadingRouteData"解决了
from vux.
试了一下,虽然可以通过list传数据进去,但是父组件是异步从server端取list的,初始化的时候会报错:
Uncaught TypeError: Cannot read property 'value' of undefined
Uncaught TypeError: Cannot read property 'name' of undefined
from vux.
传进去是数据还是空的?
from vux.
我是在父组件的created钩子里异步从server端加载数据,然后设置到父组件的data.list里,address组件的list和父组件data.list绑定。这样用对么?
from vux.
这样的话,address组件一开始会没有数据,初始化失败。如果你用vue-router的话,可以使用 data
钩子来在compile组件前进行数据获取
http://vuejs.github.io/vue-router/zh-cn/pipeline/data.html
我也在考虑支持异步设置 list 和 value,但是可能出现用户操作时list还没有获取成功的情况
from vux.
data钩子估计也不行,异步请求最终都一样
from vux.
这样子能保证在组件初始化前数据已经获取到了。
from vux.
我知道了,我尝试一下
from vux.
试了一下,貌似在data钩子调用前就js报错了
from vux.
添加 waitForData: true 呢
from vux.
@sandysong 👍 这种思路不错。
from vux.
Related Issues (20)
- ios 15.4.1 上 x-dialog 组件水平不居中,靠屏幕左边
- 多个tab-item,为什么使用demo里tab代码,点击tab-item无法自动向左滚动
- 监听input修改v-model无效
- 备用文档地址
- 版本2.2.0 ,x-input点击清空icon按钮没效果哎,这个有办法解决吗 ,需要更改源码吗? HOT 2
- after npm run build, node_modules/vux/src/components Cannot read property 'vux.alert.button_text' of undefined HOT 2
- CellFormPreview 组件IOS16下有问题 HOT 6
- demo网页不能访问了https://vux.li/demos/v2/?x-page=v2-doc-home HOT 2
- I have issues building the project in Nuxt
- 模板vue-cli-3-example 本地重新yarn后报错 HOT 1
- 支持一下SSR
- yarn run build 报错 HOT 1
- Vux官网不显示样式预览 HOT 3
- Previewer 预览再删除图片控制台报错 HOT 3
- 在nuxt中使用Scroller 会报错 HOT 1
- 现在npm 包不是最新代码吗?
- Datetime时间组件 order-map时间排列顺序 属性 不能显示上午下午 noon: 6 无效 HOT 1
- 项目支持 Vue 3 吗? HOT 4
- X-number相关
- x-number 的@on-change方法不触发
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 vux.