Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Aug 4, 2021
1 parent e235ef2 commit fa9fd23
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 19 deletions.
30 changes: 19 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>

<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="https://unpkg.com/vue@next"></script>
<!-- import CSS -->
<link rel="stylesheet" href="https://unpkg.com/element-plus/lib/theme-chalk/index.css">
<!-- import JavaScript -->
<script src="https://unpkg.com/element-plus/lib/index.full.js"></script>
<title>Vite App</title>
</head>

<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>

</html>
2 changes: 1 addition & 1 deletion prettier.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
printWidth: 80,
printWidth: 120,
tabWidth: 4,
useTabs: false,
singleQuote: true,
Expand Down
17 changes: 17 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,32 @@

<el-scrollbar>
<el-alert title="成功提示的文案" type="success"> </el-alert>

<el-card>
<el-input></el-input>
<el-button type="text" @click="open"
>点击打开 Message Box</el-button
>
</el-card>
<p class="item" v-for="item in 200" :key="item">{{ item }}</p>
</el-scrollbar>
</template>

<script setup>
import data from './data/data.json'
import { ElMessageBox } from 'element-plus'
import { ElMessage } from 'element-plus'
const open = () => {
ElMessageBox.alert('这是一段内容', '标题名称', {
confirmButtonText: '确定',
callback: action => {
ElMessage({
type: 'info',
message: `action: ${action}`,
})
},
})
}
console.log(data)
</script>

Expand Down
2 changes: 1 addition & 1 deletion src/styles/global.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#app h1 {
color: hotpink;
color: hotpink;
}
8 changes: 2 additions & 6 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,13 @@ export default defineConfig({
base: './',
plugins: [
vue(),
ViteComponents({
customComponentResolvers: [ElementPlusResolver()],
}),
ViteComponents({ customComponentResolvers: [ElementPlusResolver()] }),
styleImport({
libs: [
{
libraryName: 'element-plus',
esModule: true,
resolveStyle: name => {
return `element-plus/lib/theme-chalk/${name}.css`
},
resolveStyle: name => `element-plus/lib/theme-chalk/${name}.css`,
},
],
}),
Expand Down

0 comments on commit fa9fd23

Please sign in to comment.