npm install game-text
- json
{
"usingComponents": {
"game-text": "game-text/text"
}
}
- mini.project.json
{
"node_modules_es6_whitelist": [
"game-text"
]
}
- js
Page({
data: {
textData: {
name: "自定义文字",
text: "{num}",
placeholder: "{num}",
placeText: "0",
width: 750,
height: 32,
left: 204,
top: 16,
fontSize: 24,
color: "#63c0f3",
// fontWeight: "bold",
textAlign: "left"
},
},
})
- xaml
<game-text component-data="{{textData}}" />