-
Notifications
You must be signed in to change notification settings - Fork 45
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
KPickerView 设置默认值 web端和小程序端实际结果不同 #21
Labels
bug
Something isn't working
Comments
好的,这个我跟进看一下 |
已经修复了,可以使用 |
在mp下不响应事件,web下正常 <template>
<KView>
<div class="weui-cells__title">内容</div>
<div class="weui-cells weui-cells_form">
<div class="weui-cell weui-cell_active">
<div class="weui-cell__bd">
<textarea class="weui-textarea"
placeholder="请输入海报内容"
rows="10"
maxlength="-1"
v-model="posterText"></textarea>
</div>
</div>
</div>
<div class="weui-cells__title">背景色</div>
<KPickerView indicator-style="height: 60px;"
v-model="colorIndex"
style="width: 100%; height:120px;"
@change="changeColor">
<KPickerViewColumn>
<KView v-for="(item,index) in colors"
:style="{lineHeight: '80px', backgroundColor: item}"
:key="index" >
</KView>
</KPickerViewColumn>
</KPickerView>
<div class="weui-cells__title">预览</div>
<div class="weui-cell"
:style="{backgroundColor: color, color: '#FFFFFF'}">
{{ posterText ? posterText : '这是海报正文' }}
</div>
<div class="weui-cell">
<KButton type="primary" @click="save">保存图片</KButton>
</div>
</KView>
</template>
<script>
import Vue from 'vue'
export default Vue.extend({
name: 'Home',
data() {
return {
posterText: null,
colors: [
'#2C2C2E',
'#0A84FF',
'#30D158',
'#5E5CE6',
'#FF9F0A',
'#FF375F',
'#BF5AF2',
'#FF453A',
'#64D2FF',
'#FFD60A',
],
colorIndex: 0,
color: null,
}
},
computed: {
},
components: {
},
created() {
window.addEventListener('wxload', query => console.log('page1 wxload', query))
window.addEventListener('wxshow', () => console.log('page1 wxshow'))
window.addEventListener('wxready', () => console.log('page1 wxready'))
window.addEventListener('wxhide', () => console.log('page1 wxhide'))
window.addEventListener('wxunload', () => console.log('page1 wxunload'))
this.color = this.colors[this.colorIndex]
},
methods: {
changeColor(index) {
this.color = this.colors[index]
this.posterText = index
},
save() {
}
},
})
</script>
<style lang="less">
</style>
|
已经修复,为了对齐小程序。目前 index 修改为 array 的传入方式:
可以使用 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
web端初始位置无效,小程序正常
The text was updated successfully, but these errors were encountered: