Skip to content

Commit

Permalink
use a separate file for store
Browse files Browse the repository at this point in the history
  • Loading branch information
wxiaoguang committed Apr 8, 2023
1 parent 37f7dd8 commit d24f8db
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion web_src/js/components/DiffFileTree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
</template>

<script>
import DiffFileTreeItem, {store} from './DiffFileTreeItem.vue';
import DiffFileTreeItem from './DiffFileTreeItem.vue';
import {doLoadMoreFiles} from '../features/repo-diff.js';
import {toggleElem} from '../utils/dom.js';
import {store} from './DiffFileTreeStore.js';
const {pageData} = window.config;
const LOCAL_STORAGE_KEY = 'diff_file_tree_visible';
Expand Down
6 changes: 1 addition & 5 deletions web_src/js/components/DiffFileTreeItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,7 @@
<script>
import {SvgIcon} from '../svg.js';
import {reactive} from 'vue';
export const store = reactive({
selectedItem: '',
});
import {store} from './DiffFileTreeStore.js';
export default {
components: {SvgIcon},
Expand Down
5 changes: 5 additions & 0 deletions web_src/js/components/DiffFileTreeStore.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {reactive} from 'vue';

export const store = reactive({
selectedItem: '',
});

0 comments on commit d24f8db

Please sign in to comment.