Skip to content

Commit

Permalink
feat: 改用js
Browse files Browse the repository at this point in the history
  • Loading branch information
lixunchang committed Oct 9, 2024
1 parent 458abbf commit ee6b8cc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
<script type="module" src="/src/main.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion src/main.ts → src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import App from './App.vue';
import router from './router';
import 'element-plus/dist/index.css'
import './assets/main.css';
import axios from 'axios';
// import axios from 'axios';


const app = createApp(App)
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions src/views/SearchView.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script setup lang="ts">
<script setup>
import { reactive, watch } from 'vue';
import allWords from '@/utils/words';
import { isAscending } from '@/utils/common';
Expand All @@ -15,7 +15,7 @@ const state = reactive({
searchHistory: JSON.parse(localStorage.getItem('search-history')||'[]')
})
const limitStatus: any={
const limitStatus={
0:'success',
1:'warning',
2:'primary',
Expand All @@ -24,7 +24,7 @@ const limitStatus: any={
}
const getWordExplain=(newWord: string)=>{
const getWordExplain=(newWord)=>{
console.log('newWord', newWord)
if(!state.explain[newWord]){
state.explain[newWord]={};
Expand All @@ -35,7 +35,7 @@ const getWordExplain=(newWord: string)=>{
// text: '这个单词几个意思...',
// fullscreen: false
// })
DictionaryService.getWordMean(newWord).then(({data}:any)=>{
DictionaryService.getWordMean(newWord).then(({data})=>{
state.explain[newWord] = data;
localStorage.setItem(newWord, JSON.stringify(data))
state.explain[newWord].loadingStatus = '';
Expand Down

0 comments on commit ee6b8cc

Please sign in to comment.