vant - 头部 - header【Layout 布局】【Icon 图标】

 安装css

npm i vant -Shtml

【main.js】vue

import Vant from 'vant';
import 'vant/lib/index.css';
Vue.use(Vant);

【index.html】npm

<!-- 引入样式 -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@1.4/lib/index.css">
        
<!-- 引入组件 -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vant@1.4/lib/vant.min.js"></script>

【HelloWorld.vue】布局

<template>
    <div class="hello">
        <van-row class="m-header">
            <van-col span="24">
                <van-icon name="arrow-left" class="m-header-icon" />
          内容
       </van-col> </van-row> </div> </template>

 

<style scoped>
    .m-header {
        height: 50px;
        line-height: 50px;
        background: #245fd7;
        color: #fff;
    }
    
    .m-header-icon {
        position: absolute;
        top: 16px;
        left: 6px;
        font-size: 18px;
    }
</style>

 具体参数查看vant API 【Layout 布局】【Icon 图标】spa

相关文章
相关标签/搜索