1 Star 6 Fork 5

Layui Vue/sandbox-vue

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

sandbox-vue

Netlify Status

一个 Vue3 SFC 沙盒。https://github.com/Sight-wcg/sandbox-vue 输入图片说明 输入图片说明 输入图片说明 输入图片说明

快速开始

// 下载
git clone https://gitee.com/layui-vue/layui-vue-playground.git

// 安装依赖
pnpm install

// 运行
pnpm dev

配置

 1. 配置基本信息和组件库依赖 src/config/sandbox.config.js

// 基本信息
export const config = {
  // 网站 title
  title: 'sandbox-vue',
  // UI 库包名
  UIPackage: '@layui/layui-vue',
  // 版本选择框显示的最小版本
  minSupportedVersion: '0.2.5',
  // 是否过滤预发布版本
  filterPreRelease: false,
  // APP.vue 内容模板
  defaultAppTemplate: defaultAppTemplate.trim()
}

// 依赖源
export interface DependencySource {
  // 依赖源名称
  name: string;
  // 依赖源链接
  url: string;
}

// 依赖
export interface Dependency {
  // 包名
  name: string;
  // 描述
  description?: string;
  // 版本
  version?: string;
  // 路径
  path: string;
  // 样式路径
  stylePath?: string;
  // 依赖源
  source?: DependencySource["name"];
}

2. APP.vue 模板  /src/config/defaultAppTemplate.vue 

<script setup lang="ts">
import { ref } from 'vue'

const msg = ref('Hello World!')
</script>

<template>
  <h1>{{ msg }}</h1>
  <input v-model="msg" />
</template>

下载功能需要自行修改 /src/download/template/** 下的模板文件

部署静态站点

  1. 构建应用

运行 pnpm build 命令来执行应用的构建,默认情况下,构建会输出到 dist 文件夹中

pnpm build
  1. 本地测试应用

构建完成应用后,通过运行 pnpm preview 命令,在本地测试该应用。

pnpm build
pnpm preview
  1. github/gitee pages

vite.config.js中设置正确的 base

如果要部署在 https://<USERNAME>.github.io/ 上,可以省略 base 使其默认为 '/'

如果要部署在 https://<USERNAME>.github.io/<REPO>/ 上,例如仓库地址为 https://github.com/<USERNAME>/<REPO>,那么需要设置 base 为 '/<REPO>/'

感谢

MIT License Copyright (c) 2022 @layui/layui-vue Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Sandbox-vue 是 一 个 Vue 3.0 SFC 可 配 置 沙 盒 环 境. 最新地址: 1. https://sandbox-vue.netlify.app 2. http://sandbox-vue.vercel.app 展开 收起
README
MIT
取消

发行版 (1)

全部
3年前

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/layui-vue/sandbox-vue.git
git@gitee.com:layui-vue/sandbox-vue.git
layui-vue
sandbox-vue
sandbox-vue
master

搜索帮助