Skip to content

Commit

Permalink
feat: (rebased)ts改造中
Browse files Browse the repository at this point in the history
  • Loading branch information
lvjiaxuan committed Apr 5, 2021
1 parent a1ceb28 commit 5ac2944
Show file tree
Hide file tree
Showing 9 changed files with 155 additions and 44 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
20 changes: 20 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"lint-staged": "^10.5.4",
"prettier": "^2.2.1",
"sass": "^1.32.8",
"typescript": "^4.2.3",
"vite": "^2.1.5"
},
"config": {
Expand Down
100 changes: 87 additions & 13 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,96 @@
<template>
<img alt="Vue logo" src="./assets/logo.png" />
<HelloWorld msg="Hello Vue 3 + Vite" />
<number-roll />
</template>

<script setup>
import HelloWorld from './components/HelloWorld.vue'
<script setup lang="ts">
import NumberRoll from './components/NumberRoll.vue'
// This starter template is using Vue 3 experimental <script setup> SFCs
// Check out https://github.com/vuejs/rfcs/blob/script-setup-2/active-rfcs/0000-script-setup.md
</script>

<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
<style lang="scss">
.title {
text-align: center;
color: #2c3e50;
margin-top: 60px;
color: #5026a7;
font-size: 60px;
}
.container {
text-align: center;
}
.options {
display: flex;
flex-wrap: wrap;
justify-content: center;
margin: 20px 0;
label {
display: inline-block;
margin: 15px 30px 15px 0;
}
input[type=text], input[type=number] {
display: inline-block;
padding: 4px 7px;
width: 70px;
height: 25px;
cursor: text;
font-size: 12px;
line-height: 1.5;
color: rgba(0, 0, 0, .65);
background-color: #fff;
background-image: none;
border: 1px solid #d9d9d9;
border-radius: 4px;
transition: all .3s;
}
input[type=checkbox] {
margin: 0;
width: 25px;
height: 25px;
}
}
button {
margin-top: 10px;
color: #470938;
width: 100%;
margin-bottom: 0;
font-weight: 500;
text-align: center;
touch-action: manipulation;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
white-space: nowrap;
line-height: 1.5;
padding: 10px 15px;
font-size: 16px;
border-radius: 4px;
user-select: none;
transition: all .3s cubic-bezier(.645, .045, .355, 1);
background-color: #fff;
border-color: #d9d9d9;
&:hover {
color: #1a3e59;
background-color: #f2d6eb;
}
}
code {
margin-top: 25px;
display: block;
padding: 8px 15px;
background-color: #f6f8fa;
border-radius: 5px;
border: 1px solid #e5e5e5;
overflow-x: auto;
color: #333;
font-size: 14px;
&.css-style {
white-space: pre-wrap;
}
}
.num-item {
border-radius: 8px;
width: 100px;
margin: 10px;
background: linear-gradient(0deg,rgba(100,184,255,1) 0%,rgba(0,120,255,1) 50%,rgba(100,184,255,1) 100%);
font-size: 80px;
color: #fff;
}
</style>
30 changes: 0 additions & 30 deletions src/components/HelloWorld.vue

This file was deleted.

31 changes: 31 additions & 0 deletions src/components/NumberRoll.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<template>
<p>xxx</p>
</template>

<script setup="props" lang="ts">
</script>

<style lang="scss" scoped>
.base-num-roll {
margin: 0;
padding: 0;
list-style: none;
overflow: hidden;
display: inline-flex;
li {
transition-property: transform;
box-sizing: border-box;
margin-top: 0 !important;
margin-bottom: 0 !important;
p {
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
}
}
}
</style>
File renamed without changes.
15 changes: 15 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"strict": true,
"jsx": "preserve",
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"lib": ["esnext", "dom"],
"types": ["vite/client"]
},
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
}
File renamed without changes.

0 comments on commit 5ac2944

Please sign in to comment.