Skip to content

编译到微信小程序的数据更新问题 #2696

Closed
@ctrlv-git

Description

问题描述
绑定的数据,赋值0的时候编译到小程序时,不更新。

复现步骤

<template>
	<view class="content">
		<text class="title">{{ title }}</text>
	</view>
</template>
<script>
export default {
	data() {
		return {
			title: ''
		};
	},
	onLoad() {
		this.title = 0;
	},
	methods: {}
};
</script>

实际结果
问题仅出现在小程序,目前遇到有微信小程序和钉钉小程序。
当定义的title是空字符串的时候,后续再赋值为0时,页面数据不会更新,赋值其它非0值时,表现正常。
当定义的titlenull,undefined时,不会有这个问题。

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions