惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
H
Help Net Security
博客园_首页
P
Privacy International News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tenable Blog
Latest news
Latest news
D
Darknet – Hacking Tools, Hacker News & Cyber Security
爱范儿
爱范儿
Cyberwarzone
Cyberwarzone
P
Palo Alto Networks Blog
月光博客
月光博客
有赞技术团队
有赞技术团队
Know Your Adversary
Know Your Adversary
博客园 - 叶小钗
P
Proofpoint News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
S
Schneier on Security
A
About on SuperTechFans
F
Full Disclosure
The Cloudflare Blog
T
The Exploit Database - CXSecurity.com
S
SegmentFault 最新的问题
Apple Machine Learning Research
Apple Machine Learning Research
Microsoft Security Blog
Microsoft Security Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
N
News and Events Feed by Topic
www.infosecurity-magazine.com
www.infosecurity-magazine.com
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Webroot Blog
Webroot Blog
量子位
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
美团技术团队
Help Net Security
Help Net Security
Microsoft Azure Blog
Microsoft Azure Blog
GbyAI
GbyAI
云风的 BLOG
云风的 BLOG
Y
Y Combinator Blog
博客园 - 司徒正美
N
Netflix TechBlog - Medium
S
Security @ Cisco Blogs
B
Blog
P
Privacy & Cybersecurity Law Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
Hacker News - Newest:
Hacker News - Newest: "LLM"
V
Visual Studio Blog
NISL@THU
NISL@THU

博客园 - ddrsql

从“黑盒”到“全景”:在.NET中拥抱OpenTelemetry与SigNoz的可观测工具 关于git分支堆叠 记录团队使用git合并代码丢失 记一次对老服务改造 国产麒麟(Kylin-Server-10)系统无外网环境安装docker vue3学习之axios、mockjs、nswag vue3学习之BootstrapVueNext Framework升级到Core以及Dapper支持达梦数据库 Avalonia集成Prism与Abp Avalonia中使用EF增删改查DM数据库 Linux中使用原生Wpf之Avalonia WPF通过wine适配统信uos系统 单体仓库下通过helm优雅的将微服务部署到k8s DevOps 前端项目(angular、vue、react)打包静态资源生成一份Docker镜像支持部署不同环境 VS使用IIS调试(非附加进程).net core、.net framework程序 k8s集群通过nginx-ingress做tcp、udp 4层网络转发 DevOps .net core Jenkins持续集成Linux、Docker、K8S swaggerui集成oauth implicit redis cluster集群web管理工具 relumin
vue3学习之tabler组件Layout布局
ddrsql · 2023-04-19 · via 博客园 - ddrsql

上一篇使用的bootstrap-vue-next项目迭代很快,考虑还未发文档和正式版本(自己菜)改用原生bootstrap模板tabler项目。

tabler

安装运行

不想安装可直接打开tabler\demo目录下html文件浏览查看效果

#获取后目录下运行
npm install
#需要先安装https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.7.6-1/rubyinstaller-devkit-2.7.6-1-x64.exe
bundler install
#启动
npm run start-plugins

布局草图

先来个草图,做一个类似这样的布局

使用Tabler布局

main.ts添加tabler

import './assets/tabler.css'
import './assets/tabler.js'

src/components目录下添加

AppLayout.vue

<script setup lang="ts">
import AppHeader from './AppHeader.vue'
import AppPageWrapper from './AppPageWrapper.vue'
</script>

<template>
<div class="page">
    <AppHeader/>
     <div class="page-wrapper">
        <RouterView /> <!-- 嵌套路由 <AppPageWrapper/> -->
        <AppFooter/>
    </div>
</div>
</template>

<style scoped lang="scss">
</style>

AppHeader.vue

<script setup lang="ts">
</script>

<template>
      <!-- Navbar -->
      <div class="sticky-top">
        <header class="navbar navbar-expand-md navbar-light sticky-top d-print-none">
          <div class="container-xl">
            ...
          </div>
        </header>
        
        <header class="navbar-expand-md">
          <div class="collapse navbar-collapse" id="navbar-menu">
            ...
          </div>
        </header>
      </div>
</template>

<style scoped lang="scss">
</style>

AppPageWrapper.vue

<script setup lang="ts">
import AppFooter from './AppFooter.vue'
</script>

<template>
 <div class="page-wrapper">
  <!-- carousel -->
    <div style="height:200px">
      <div id="carousel-indicators" class="carousel slide" data-bs-ride="carousel">
        ...
      </div>
    </div>
    <!-- Page body -->
    <div class="page-body">
        <div class="container">
            <div class="row row-deck row-cards">
                <div class="col-md-12 col-lg-8">
                  ...
                </div>
                <div class="col-md-6 col-lg-4">
                  ...
                </div>
            </div>
        </div>
    </div>
    <AppFooter/>
</div>
</template>

<style scoped lang="scss">
</style>

AppFooter.vue

<script setup lang="ts">
</script>

<template>
  <footer class="footer footer-transparent d-print-none">
    <div class="container-xl">
      ...
    </div>
  </footer>
</template>

<style scoped lang="scss">
</style>

修改router/index.ts

import AppLayout from '@/components/layout/AppLayout.vue'
//....
  routes: [
    {
      path: '/',
      name: 'applayout',
      redirect: '/home',
      component: AppLayout,
      children: [
        {
          // AppPageWrapper 将被渲染到 AppLayout 的 <routerview> 内部
          path: 'home',
          component: AppPageWrapper,
        },
        {
          path: 'about',
          component: () => import('../views/AboutView.vue')
        }
      ]
    },
//....

运行效果

示例代码