1、RsourceModel数据绑定
i18n文件:
存放不经常变化的文字,如在<page></page>
中的title =”{i18n>title}”,按钮文字,输入框提示文字,placeholder newTitle = hijuly
manifest.json 文件
modes中配置当前项目的基础models,resourcemodel如下:
"models": {
"i18n": {
"type": "sap.ui.model.resource.ResourceModel",
"settings": {
"bundleName": "new_test02.i18n.i18n"
}
}
}
其中bundleName指明文件所在路径,页面上的所有数据都由model提供,服务器取回来的数据必须封装成jsonmodel才能绑定在页面上
jsonmodel的配置,type表示它的种类,uri表示它的路径如下:
"model名":{
"type": "sap.ui.model.json.JSONModel",
"uri": "Invoices.json" //数据文件路径
}
App.view.xml文件
-title="{模块名>属性名}"
<Page title="{i18n>title}">
<content></