Skip to content

Commit

Permalink
[^]优化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyupo committed Mar 25, 2024
1 parent 8dcfb57 commit 6af66e2
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/stores/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ export const useGameStore = defineStore("game", {
Object.assign(data);
},
},
persist: true, // localstorage yes or no
persist: false, // localstorage yes or no
});
2 changes: 1 addition & 1 deletion src/views/end/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<div class="end">
<p class="underline underline-offset-8 italic">本项目使用 v3s 进行开发</p>
<a href="https://github.com/wangyupo/v3s" target="_blank" title="跳转至 v3s github地址">
<img src="/public/v3s.jpg" class="mt-3 w-[200px] cursor-pointer" />
<img src="/v3s.jpg" class="mt-3 w-[200px] cursor-pointer" />
</a>
<p class="mt-3 flex items-baseline">
* 推荐使用
Expand Down
17 changes: 1 addition & 16 deletions src/views/game/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,14 @@

<script setup>
import Map from "./components/GameMap.vue";
import { ref, onMounted, computed } from "vue";
import { onBeforeRouteLeave } from "vue-router";
import { cloneDeep } from "lodash-es";
import { useGameStore } from "@/stores/game.js";
import { storeToRefs } from "pinia";
const gameStore = useGameStore();
const { game } = storeToRefs(gameStore);
// import { useStore } from "vuex";
// const store = useStore();
// const state = computed(() => store.state.game);
const stateClone = ref();
onMounted(() => {
stateClone.value = cloneDeep(game.value);
});
onBeforeRouteLeave((to, from) => {
// store.commit("game/resetAllState", stateClone.value);
gameStore.resetAllState(stateClone.value);
gameStore.$reset();
});
</script>

Expand Down
2 changes: 1 addition & 1 deletion src/views/v3s/1-what/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<p>为了大家在阅读完本书籍后,能直接使用 vue3 做项目。从本节开始,大家就需要了解 v3s 。</p>
<p class="mt-3">放心,这里只会简单的介绍 v3s 的使用方法,而你也只需要这些,就完全能够独立完成 vue3 的项目。</p>
<p class="mt-3">是的 v3s 就是这么优秀,它足以让你立刻进入开发。</p>
<img src="/public/v3s.jpg" class="mt-3 w-[200px]" />
<img src="/v3s.jpg" class="mt-3 w-[200px]" />
</div>
</template>

Expand Down
2 changes: 1 addition & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { visualizer } from "rollup-plugin-visualizer";
const PROXY_TARGET = "http://t.weather.itboy.net/"; // 后端服务地址

export default defineConfig({
base: "/v3s-admin/",
base: "/vue3-cookbook-website/",
plugins: [
vue(),
visualizer({
Expand Down

0 comments on commit 6af66e2

Please sign in to comment.