vue-圣杯布局实例

本文介绍如何配置Vue环境并创建Vue项目,包括使用仅运行时版本、配置vue.config.js以解决模板编译问题,以及安装和引入Element UI和Vue-router等依赖。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

写在前面

为了能够在下次实现前端页面的快速开发。

创建vue项目

vue环境配置

vue项目创建

vue creat ol_vue02

选择的是default,这个版本是仅运行时版本,不包含编译器。
详见https://www.cnblogs.com/xiaonian8/p/13705109.html

要配置文件:在项目目录下新建vue.config.js,写入以下代码:

module.exports = {
  //Solution For Issue:You are using the runtime-only build of Vue where the template compiler is not available. Either pre-compile the templates into render functions, or use the compiler-included build.
  //zhengkai.blog.youkuaiyun.com
  runtimeCompiler: true
}

依赖配置

安装依赖

element-ui

cnpm i element-ui -S

vue-router

npm install vue-router --save

引入依赖

import Vue from 'vue'
import App from './App'
import router from './router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

参考文献

[1]圣杯布局详解 https://zhuanlan.zhihu.com/p/40327389
[2]仅运行时版本报错处理https://zhengkai.blog.youkuaiyun.com/article/details/107182655
[3]vue的完整版和运行时版的区别https://www.cnblogs.com/xiaonian8/p/13705109.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值