|
你要补基础知识,stml 文件结构,js 方法怎么写。
app.json 是 openTabLayout 方法作为首页时的配置方法 ,就是进入APP就打开配置的几个tab 页面。而使用 api.openTabLayout(param); 方法,可以在进入app 后的页面中调用。
- <template>
- <view class="page">
- </view>
- </template>
- <script>
- export default {
- name: 'test',
- apiready() {//like created
- },
- data() {
- return {
- }
- },
- methods: {
- fnopenMyTab() {
- var param = {
- name: 'nav-tab',
- title: 'nav-tab',
- bgColor: '#fff',
- slidBackEnabled: false,
- navigationBar: {
- hideBackButton: true
- },
- tabBar: {
- animated: true,
- list: [
- {
- text: "微信",
- iconPath: "widget://image/nav_tab_1.png",
- selectedIconPath: "widget://image/nav_tab_1_on.png"
- }, {
- text: "通讯录",
- iconPath: "widget://image/nav_tab_2.png",
- selectedIconPath: "widget://image/nav_tab_2_on.png"
- }, {
- text: "发现",
- iconPath: "widget://image/nav_tab_3.png",
- selectedIconPath: "widget://image/nav_tab_3_on.png"
- }, {
- text: "我",
- iconPath: "widget://image/nav_tab_4.png",
- selectedIconPath: "widget://image/nav_tab_4_on.png"
- }
- ],
- frames: [
- {
- title: "微信",
- name: "tab_frm_1",
- url: "widget://html/tab_content_1.html"
- }, {
- title: "通讯录",
- name: "tab_frm_2",
- url: "widget://html/tab_content_2.html"
- }, {
- title: "发现",
- name: "tab_frm_3",
- url: "widget://html/tab_content_3.html"
- }, {
- title: "我",
- name: "tab_frm_4",
- url: "widget://html/tab_content_4.html"
- }
- ]
- }
- }
- api.openTabLayout(param);
- }
- }
- }
- </script>
- <style>
- .page {
- height: 100%;
- }
- </style>
复制代码丑萌的小白 · 2022-8-22 21:41我是按照你给我的第一个链接里的案例基本一模一样的。我查了两个小时的资料,又看了你给我的最新那个链接,我还是不太明白。究竟是因为我用了可视化stml的缘故吗?因为案例里是自建一个app.json放在widget里了,而我 ... |
|