当前位置: 首页 > news >正文

Vue进阶之Vue无代码可视化项目(三)

Vue无代码可视化项目

  • 项目初始化
    • store的使用
      • DataSourceView.vue
      • stores/counter.ts
    • 开发模式按钮
      • store/editor.ts
      • LayoutView.vue
    • 导航条
      • 安装图标icon
        • package.json
      • store/debug.ts
      • src/components/AppNavigator.vue
        • AppNavigator.ts:
        • AppNavigator.vue:
      • theme样式
        • theme/reset.css
        • theme/variable.css
        • theme/base.css
        • theme/main.css
      • main.ts
      • App.vue
      • router/index.ts

项目初始化

store的使用

DataSourceView.vue

<template><div class="about"><h1>DataSource {{ store.count }}-{{ store.double }}<button @click="store.increment">+</button><button @click="store.decrement">-</button></h1></div>
</template><script lang="ts" setup>
import {useCounterStore} from '@/stores/counter'// 丢掉响应式
// const {count,increment,double,decrement} = useCounterStore()
const store=useCounterStore()
</script><style>
@media (width >= 1024px) {.about {min-height: 100vh;display: flex;align-items: center;}
}
</style>

stores/counter.ts

import { ref, computed } from 'vue'
import { defineStore } from 'pinia'export const useCounterStore = defineStore('counter', () => {const count=ref(0)const double=computed(()=>count.value*2)const increment=()=>{count.value++}const decrement=()=>{count.value--}return{count,double,increment,decrement}
})

请添加图片描述

开发模式按钮

创建editor.ts文件

  • store
    • editor.ts

store/editor.ts

import { ref } from 'vue'
import { defineStore } from 'pinia'export const useEditorStore = defineStore('editor', () => {//  开发模式const debug=ref(false)const toggleDebug=()=>{debug.value=!debug.value}return{debug,toggleDebug}
})

LayoutView.vue

<template><div class="about" :class="{debug:editorStore.debug}" @click="editorStore.toggleDebug()"><h1>Layout</h1></div>
</template><script lang="ts" setup>
import {useEditorStore} from '@/stores/editor'
const editorStore = useEditorStore()
</script>
<style>
@media (width >= 1024px) {.about {min-height: 100vh;display: flex;align-items: center;}.debug {border: 2px dashed #afafaf;}
}
</style>

请添加图片描述

导航条

安装图标icon

icon-park github
icon-park官网

package.json
"dependencies": {..."@icon-park/vue-next":"1.4.2"

相关文章:

  • 【Linux】用户和组的管理、综合实训
  • selenium非全新的方式同时启动多个浏览器又互不影响的一种实现方法,欢迎讨论!
  • Finance Manager System (FMS)
  • Centos7 安装nginx
  • 搜维尔科技:Varjo XR-4功能详解:由凝视驱动的XR自动对焦相机系统
  • WPF入门--多种方式设置样式(Style)
  • 英语阅读文章
  • 探索 Adobe Illustrator 2023 (AI 2023) for Mac/Win——创意设计的强大工具
  • Python_ 爬楼梯
  • Win32和c++11多线程
  • 物联网-高性能时序数据库QuestDB
  • 问题:8255A的端口A工作在方式2时,使用端口C的______作为与CPU和外部设备的联络信号。 #媒体#经验分享#其他
  • 【SpringBoot + Vue 尚庭公寓实战】项目介绍(一)
  • 浅谈提示词发展现状,Prompt 自动优化是未来。
  • 七天进阶elasticsearch[Three]
  • Android 控件背景颜色处理
  • Angular 2 DI - IoC DI - 1
  • Bytom交易说明(账户管理模式)
  • css系列之关于字体的事
  • HTTP中的ETag在移动客户端的应用
  • JavaScript创建对象的四种方式
  • javascript面向对象之创建对象
  • JavaScript中的对象个人分享
  • Mocha测试初探
  • Vue 2.3、2.4 知识点小结
  • vue-router的history模式发布配置
  • 闭包--闭包作用之保存(一)
  • 创建一个Struts2项目maven 方式
  • 从 Android Sample ApiDemos 中学习 android.animation API 的用法
  • 分享几个不错的工具
  • 深入浏览器事件循环的本质
  • 双管齐下,VMware的容器新战略
  • 网页视频流m3u8/ts视频下载
  • 移动端解决方案学习记录
  • 正则表达式
  • const的用法,特别是用在函数前面与后面的区别
  • ​LeetCode解法汇总2304. 网格中的最小路径代价
  • # 详解 JS 中的事件循环、宏/微任务、Primise对象、定时器函数,以及其在工作中的应用和注意事项
  • #我与Java虚拟机的故事#连载19:等我技术变强了,我会去看你的 ​
  • (07)Hive——窗口函数详解
  • (delphi11最新学习资料) Object Pascal 学习笔记---第13章第1节 (全局数据、栈和堆)
  • (poj1.3.2)1791(构造法模拟)
  • (带教程)商业版SEO关键词按天计费系统:关键词排名优化、代理服务、手机自适应及搭建教程
  • (附源码)spring boot车辆管理系统 毕业设计 031034
  • (附源码)计算机毕业设计ssm本地美食推荐平台
  • (附源码)计算机毕业设计SSM疫情下的学生出入管理系统
  • (附源码)计算机毕业设计大学生兼职系统
  • (三) diretfbrc详解
  • (转)mysql使用Navicat 导出和导入数据库
  • (转)自己动手搭建Nginx+memcache+xdebug+php运行环境绿色版 For windows版
  • ***汇编语言 实验16 编写包含多个功能子程序的中断例程
  • . ./ bash dash source 这五种执行shell脚本方式 区别
  • .java 9 找不到符号_java找不到符号
  • .Net CF下精确的计时器
  • .NET Framework杂记