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

猪八戒网做网站如何全网营销是什么意思

猪八戒网做网站如何,全网营销是什么意思,多店铺商城系统开源,别人帮做的网站怎么修改sass 安装 因为在使用vite 创建项目的时候,已经安装了sass,所以不需要安装。 如果要安装,那么就执行 npm i -D sass 创建文件 src 目录下创建文件 目录结构如图所示: reset.scss *, ::before, ::after {box-sizing: border-…

sass

安装

因为在使用vite 创建项目的时候,已经安装了sass,所以不需要安装。
如果要安装,那么就执行

npm i -D sass 

创建文件

src 目录下创建文件
目录结构如图所示:
在这里插入图片描述
reset.scss

*,
::before,
::after {box-sizing: border-box;border-color: currentcolor;border-style: solid;border-width: 0;
}#app {width: 100%;height: 100%;
}html {box-sizing: border-box;width: 100%;height: 100%;line-height: 1.5;tab-size: 4;text-size-adjust: 100%;
}body {width: 100%;height: 100%;margin: 0;font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB","Microsoft YaHei", "微软雅黑", Arial, sans-serif;line-height: inherit;-moz-osx-font-smoothing: grayscale;-webkit-font-smoothing: antialiased;text-rendering: optimizelegibility;
}a {color: inherit;text-decoration: inherit;
}img,
svg {display: inline-block;
}svg {// 因icon大小被设置为和字体大小一致,而span等标签的下边缘会和字体的基线对齐,故需设置一个往下的偏移比例,来纠正视觉上的未对齐效果vertical-align: -0.15em;
}ul,
li {padding: 0;margin: 0;list-style: none;
}*,
*::before,
*::after {box-sizing: inherit;
}a,
a:focus,
a:hover {color: inherit;text-decoration: none;cursor: pointer;
}a:focus,
a:active,
div:focus {outline: none;
}
body {background: pink;
}

index.scss

@use "./reset";

variables.scss

// src/styles/variables.scss
$bg-color: red;

上面导入的 SCSS 全局变量在 TypeScript 不生效的,需要创建一个以 .module.scss 结尾的文件
variables.module.scss

// 导出 variables.scss 文件的变量
:export {bgColor: $bg-color;
}

引用

main.ts 中配置

import { createApp } from "vue";
import "@/style.css";
import App from "@/App.vue";
// element-plus 引入icon
import { setupElIcons } from "@/plugins";
// 引入svg
import "virtual:svg-icons-register";
// 引入样式
import "@/styles/index.scss";
const app = createApp(App);
// 全局注册Element-plus图标
setupElIcons(app);
app.mount("#app");

vite.config.ts 中配置

// UserConfig,ConfigEnv 都是类型约束
import { UserConfig, ConfigEnv, loadEnv, defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
// 配置vue使用jsx
import vueJsx from "@vitejs/plugin-vue-jsx";// 以下三项引入是为配置Element-plus自动按需导入
import AutoImport from "unplugin-auto-import/vite";
import Components from "unplugin-vue-components/vite";
import { ElementPlusResolver } from "unplugin-vue-components/resolvers";// 引入svg
import { createSvgIconsPlugin } from "vite-plugin-svg-icons";// 引入路径
import { resolve } from "path";// 指定路径 使用 @ 代替/src
const pathSrc = resolve(__dirname, "src");// https://vitejs.dev/config/export default defineConfig(({ mode }: ConfigEnv): UserConfig => {return {resolve: {alias: {"@": pathSrc,},},plugins: [vue(),// jsx、tsx语法支持vueJsx(),AutoImport({// 自动导入 Vue 相关函数,如:ref, reactive, toRef 等imports: ["vue", "pinia", "vue-router"],resolvers: [// 自动导入 Element Plus 相关函数,如:ElMessage, ElMessageBox... (带样式)ElementPlusResolver(),],eslintrc: {enabled: true, //  默认 false, true 启用生成。生成一次就可以,避免每次工程启动都生成,一旦生成配置文件之后,最好把 enable 关掉,即改成 false。//  否则这个文件每次会在重新加载的时候重新生成,这会导致 eslint 有时会找不到这个文件。当需要更新配置文件的时候,再重新打开// 浏览器需要访问所有应用到 vue/element api 的页面才会生成所有自动导入 api 的文件 jsonfilepath: "./.eslintrc-auto-import.json",// 默认就是 ./.eslintrc-auto-import.jsonglobalsPropValue: true,},vueTemplate: true, // 默认 true 是否在vue 模版中自动导入dts: resolve(pathSrc, "typings", "auto-import.d.ts"), //  自动导入组件类型声明文件位置,默认根目录}),Components({resolvers: [// 自动导入 Element Plus 组件ElementPlusResolver(),],dts: resolve(pathSrc, "typings", "components.d.ts"), //  自动导入组件类型声明文件位置,默认根目录}),// 通过 createSvgIconsPlugin() 入参指定了svg 文件所在的目录和 symbolId。createSvgIconsPlugin({// Specify the icon folder to be cachediconDirs: [resolve(process.cwd(), "src/assets/icons")],// Specify symbolId format// symbolIdsymbolId: "icon-[dir]-[name]",}),],// vite.config.tscss: {// CSS 预处理器preprocessorOptions: {//define global scss variablescss: {javascriptEnabled: true,additionalData: `@use "@/styles/variables.scss" as *;`,},},},};
});

使用

HelloWord.vue

<script setup lang="ts">
import { ref } from "vue";
import variables from "@/styles/variables.module.scss";
defineProps<{ msg: string }>();const count = ref(0);
</script><template><div><el-button>Default</el-button><el-button type="primary">Primary</el-button><el-button type="success">Success</el-button><el-button type="info">Info</el-button><el-button type="warning">Warning</el-button><el-button type="danger">Danger</el-button><hr /><el-icon size="16" color="red"><Edit /></el-icon><hr /><svg-icon icon-class="refresh" spin />刷新<hr /><div class="test-css">测试是否引入了颜色</div><hr /><div :style="{ 'background-color': variables['bgColor'] }">测试全局使用</div></div>
</template><style scoped lang="scss">
.read-the-docs {color: #888;
}
.test-css {width: 100px;height: 100px;background-color: $bg-color;
}
</style>

效果展示

在这里插入图片描述

http://www.wangmingla.cn/news/9891.html

相关文章:

  • 培训学校 网站费用电话营销
  • wordpress的图片插件北京seo产品
  • 个人网站做装修可以吗移动端关键词排名优化
  • 自己做网站需要买哪些广东云浮疫情最新情况
  • 当牛做吗网站源代码分享百度云长尾关键词挖掘精灵
  • 免费做漫画网站店铺推广
  • 怎么做有邀请码的网站web免费网站
  • 网站备案好麻烦如何在互联网推广自己的产品
  • 浙江网站建设报价百度推广开户公司
  • 做兼职靠谱的网站企业seo职位
  • 昆山张浦做网站沈阳网络营销推广的公司
  • 很有风格的网站有哪些百度权重是什么
  • 合肥营销网站建设价格某一网站seo策划方案
  • 心理咨询在线免费咨询网站移动端优化工具
  • 网站建设 千助怎么推广一个app
  • 一级a做爰片免费网站一本道lpl赛区战绩
  • 织梦网站去除技术支持网络推广是网络营销的基础
  • 天津外贸网站建设公司广东做seo的公司
  • 黄网站开发网站搭建步骤
  • 陕西建设系统个人信息查询网站sem推广案例
  • 网站子目录怎么做的百度销售系统
  • wordpress配置首页手机网络优化软件
  • 衡水购物网站制作百度排行榜风云榜
  • 大型门户网站开发案例国外搜索引擎网站
  • 用java怎么做网站百度开户公司
  • 怎么样给一个网站做自然排名潍坊网站建设seo
  • 网站开发助理是什么公司要做seo
  • 大亚湾住建局网站建设工程规划南宁关键词排名公司
  • 织梦网站后台进不去广州网络推广万企在线
  • 网站建设存在风险河北关键词seo排名