UniApp 字符串插值:如何在字符串中插入变量 | UniApp 教程
<template>
<view>
<text>{{ message }}</text>
</view>
</template>
<script>
export default {
data() {
return {
message: "Hello, {{name}}!"
}
},
mounted() {
this.message = this.message.replace("{{name}}", "UniApp");
}
}
</script>
原文地址: https://www.cveoy.top/t/topic/pxFa 著作权归作者所有。请勿转载和采集!