5、此时访问 http://localhost:8080/login 可以看到下面界面 添加 home.vue 组件 home 组件是登录成功后要跳转到的组件,该组件包含一个子组件 top-bar。 ></top-bar> </el-header> <el-main> 这是正文部分 </el-main> </el-container> </template 1、在 top-bar 组件中定义 props 2、修改 home 组件进行传值 <top-bar :code="loginName"></top-bar> 组件通讯-子组件传递到父组件 子组件传递到父组件使用 $emit ,本例中在 top-bar 组件中添加一个按钮,点击按钮传递参数到 home 组件,并改变 home 组件的 loginName的值。 1、top-bar 组件中添加按钮和相关事件 2、在 home 组件中进行事件接收 接口调用 在 Vue 中使用 axios 需要先进行插件的安装 npm install axios --save axios
--顶部导航-->
left; width: 100px; } h2 { background-color: #903;} </style> </head> <body>
email to: {{ email }}
-- component/pagesView/pagesView.wxml --> <view class="container"> <view class="<em>top-bar</em>"> <block ,示例代码如下: /* component/pagesView/pagesView.wxss */ .container { width: 100vw; height: 100vh; } .top-bar
.top-bar { position: relative; height: 40px; } .pb { position: absolute; width: 100%; } .top-title-field ; height: 100%; align-items: center; display: flex; justify-content: center; } <view class="<em>top-bar</em>
完成后的效果 image.png 创建顶部导航栏 在你的工程内创建Topbar.vue 代码如下 <template>
未启用 GZIP 压缩步骤 2:语义化重构(HTML 案例)重构前代码(非语义化):
section></main>
-- 行:父元素(top-bar banner nav-bar list) -->
default it's used to highlight the close button. closeElClasses: ['item', 'caption', 'zoom-wrap', 'ui', 'top-bar
collapse" data-target="#fixed-collapse-navbar" aria-expanded="false"> <span class="icon-bar <em>top-bar</em>
/layouts/default.vue : <template>
>
/fw/780/quality/90/unsharp/true/compress/true);background-repeat: no-repeat; } .top-bar {background-image
-- 上部分 -->