Comments (5)
第一个问题 需要 :style
这样写,不然你传入的就是string类型了
第二个问题 国际化的东西可以试试这个 https://github.com/kazupon/vue-i18n
第三个问题 是支持的,设置webstorm js 为es6就好,但是建议放到methods处理会优雅一点
from incubator-weex-ui.
ok,第二个我去研究下.
第三个问题,我是不知道有这种写法的.是在weex-ui
这个demo中学的.哈哈哈
第一个问题没有表达清楚.我的意思是.
- 页面
第一次加载
的时候,使用style="background-color: red"
的方式是生效的. - 但是经过@onSelected方法后,通过字面量定义的style就不生效了.
我代码中
option-text'就是一个点击后会弹出一个选项列表,选择一个选项后,通过回调执行@onSelected()方法,将选中的值,赋给页面中的item.value,页面加载后,背景都是红的,点击option-text,回调后,通过
style="background-color: red"`定义的红色背景就无效了.
以上情况有个前提就是,class
中已经定义过了style
中定义的属性,才会出现.
比如 input的选择器和style中都定义了 background-color
属性
刚学前端,遇到问题有些棘手,感谢帮忙
from incubator-weex-ui.
native 和 web 渲染都一样吗?
from incubator-weex-ui.
重新缕了一下,android端用playground预览和直接运行在android native中都有这个问题.
我写了个简单的demo.
<template>
<div style="width: 750px;">
<text style="width: 100px;height: 100px;background-color: #afddff" @click="item.value = 10"></text>
<input class="input" style="background-color: red; font-size: 50px" :value="item.value"/>
</div>
</template>
<style scoped>
.input {
background-color: gray;
}
</style>
<script>
export default {
data() {
return {
item: {
key: 2,
value: 1,
}
}
}
}
</script>
根据效果来分析是,只要input绑定的value发生了变化,那么这个input会重新渲染,但是重新渲染的时候,通过字面量赋值的style里的属性,如果在class也有,就会被忽略.
from incubator-weex-ui.
@phoenixsky 我看了看native这边都有这个问题的,建议写成{backgroundColor: red} 这样哦
内部处理问题,重新渲染没有考虑那种情况
from incubator-weex-ui.
Related Issues (20)
- weexCell assembly slot value nesting input Invalid HOT 1
- [BUG]Weex Playground无法扫描README中的二维码 HOT 1
- wxc-ep-slider 没有滑动事件的回调吗?? HOT 1
- wxc-tab-bar iphoneX系列兼容问题 HOT 1
- 开发多语言的app,weex ui支持国际化么? HOT 1
- android下loading动画无效 HOT 1
- slider nav why not use bindingX
- one of images in example returns 404
- wxc-lightbox prop show-indicator didn't work HOT 2
- wxc-loading该组件没有api更换URL,能否进行优化一下? HOT 1
- wxc-lightbox prop show-indicator didn't work HOT 1
- wxc-searchbar的bar-style要怎么设置 HOT 1
- 引入uniapp内的nvue出现页面超级大 HOT 1
- Can't find variable: env HOT 1
- web端渲染时提示TypeError: _vm._px2rem is not a function 但是native端可以正常渲染 HOT 2
- el-slider component add infinite loop HOT 1
- wxc-ep-slider 禁用滑动 HOT 1
- 如何将项目转化为微信小程序项目呢? HOT 1
- 如何修改组件样式 HOT 1
- REQUEST: Navigation Drawer
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 incubator-weex-ui.