赞
踩
不是所有的前端项目都适合使用node.js开发,有时候我们只是进行一些简单页面的开发。比如每次开发java web,thymeleaf和freemarker写的很难受,不如vue.js开发来的迅速,而且对于一个有前后端分离开发习惯的人来说,几乎可以无学习成本直接上手。特别在一些公司的老项目中,往往只能使用最原始的jsp形式开发,这是如果在jsp中使用vue.js的形式开发前端,往往事半功倍,还可以避免学习淘汰技术,顺便学习vue.js。
使用CDN形式引入vue.js
axios
echarts
element ui
ant design vue
如果是本地开发,可以将CDN指向的资源文件下载到本地进行引入
<html> <head> <title>Title</title> <!-- vue.js 2.7.14 --> <script src="https://unpkg.com/vue@2.7.14/dist/vue.min.js"></script> <!-- element 2.15.12 --> <link rel="stylesheet" href="https://unpkg.com/element-ui@2.15.12/lib/theme-chalk/index.css" /> <script src="https://unpkg.com/element-ui@2.15.12/lib/index.js"></script> <!-- ant design vue 1.7.8 --> <link rel="stylesheet" href="https://unpkg.com/ant-design-vue@1.7.8/dist/antd.min.css" /> <script src="https://unpkg.com/ant-design-vue@1.7.8/dist/antd.min.js"></script> <!-- axios 1.1.2 --> <script src="https://unpkg.com/axios@1.1.2/dist/axios.min.js"></script> <!-- echarts 5.4.1 --> <script src="https://unpkg.com/echarts@5.4.1/dist/echarts.min.js"></script> </head> <body> <div id="app"> </div> </body> <script> new Vue({ el: '#app', data() { return { } }, mounted() { }, methods: {} }) </script> <style> </style> </html>
<html> <head> <title>Title</title> <!-- vue.js 3.2.45 --> <script src="https://unpkg.com/vue@3.2.45/dist/vue.global.prod.js"></script> <!-- element plus 2.2.28 --> <link rel="stylesheet" href="https://unpkg.com/element-plus@2.2.28/dist/index.css" /> <script src="https://unpkg.com/@element-plus/icons-vue"></script> <script src="https://unpkg.com/element-plus@2.2.28"></script> <!-- ant design vue 3.2.15 --> <script src="https://unpkg.com/dayjs/dayjs.min.js"></script> <script src="https://unpkg.com/dayjs/plugin/customParseFormat.js"></script> <script src="https://unpkg.com/dayjs/plugin/weekday.js"></script> <script src="https://unpkg.com/dayjs/plugin/localeData.js"></script> <script src="https://unpkg.com/dayjs/plugin/weekOfYear.js"></script> <script src="https://unpkg.com/dayjs/plugin/weekYear.js"></script> <script src="https://unpkg.com/dayjs/plugin/advancedFormat.js"></script> <link rel="stylesheet" href="https://unpkg.com/ant-design-vue@3.2.15/dist/antd.min.css" /> <script src="https://unpkg.com/ant-design-vue@3.2.15/dist/antd.min.js"></script> <!-- axios 1.1.2 --> <script src="https://unpkg.com/axios@1.1.2/dist/axios.min.js"></script> <!-- echarts 5.4.1 --> <script src="https://unpkg.com/echarts@5.4.1/dist/echarts.min.js"></script> </head> <body> <div id="app"> </div> </body> <script> const App = { setup() { return { } }, mounted() { }, methods: {} } const { createApp, ref, reactive } = Vue createApp(App).use(ElementPlus).use(antd).mount('#app') </script> <style> </style> </html>
/* 横向弹性布局 */
flex: 1;
display: flex;
flex-flow: row wrap;
/*去除内边距和外边距*/
margin: 0;
padding: 0;
/*让边框不占宽度和高度*/
box-sizing: border-box;
width: 100%;
height: 100%;
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。