{"size": 1697, "ext": "js", "max_stars_repo_path": "src/store/module/book.js", "max_stars_repo_name": "dirstart/wx-read", "max_stars_repo_stars_event_min_datetime": "2020-05-31T15:22:29.000Z", "max_stars_repo_stars_event_max_datetime": "2020-05-31T15:22:29.000Z", "max_issues_repo_path": "src/store/module/book.js", "max_issues_repo_name": "dirstart/wx-read", "max_issues_repo_issues_event_min_datetime": "2021-05-11T11:22:21.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-27T03:23:56.000Z", "max_forks_repo_path": "src/store/module/book.js", "max_forks_repo_name": "dirstart/wx-read", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 4, "max_forks_count": null, "avg_line_length": 32.6346153846, "max_line_length": 98, "alphanum_fraction": 0.6417206836}
const book = {
  state: {
    filename: '',
    menuVisible: false,
    settingVisible: -1, // -1：不显示，0：字号，2：进度条，3：目录
    defaultFontFamily: '宋体',
    defaultFontSize: 16,
    currentBook: null,
    fontFamilyPopupVisible: false,
    defaultTheme: 'Default',
  },
  mutations: {
    SET_FILENAME: (state, filename) => {
      state.filename = filename
    },
    SET_MENUVISIBLE: (state, visible) => {
      state.menuVisible = visible
    },
    SET_SETTINGVISIBLE: (state, value) => {
      state.settingVisible = value
    },
    SET_DEFAULTFONTFAMILY: (state, value) => {
      state.defaultFontFamily = value
    },
    SET_DEFAULT_THEME: (state, value) => {
      state.defaultTheme = value
    },
    SET_DEFAULTFONTSIZE: (state, value) => {
      state.defaultFontSize = value
    },
    SET_CURRENT_BOOK: (state, value) => {
      state.currentBook = value
    },
    SET_FONTFAMILYPOPUPVISIBLE: (state, value) => {
      state.fontFamilyPopupVisible = value
    },

  },
  actions: {
    setFilename: ({ commit }, filename) => commit('SET_FILENAME', filename),
    setMenuVisible: ({ commit }, visible) => commit('SET_MENUVISIBLE', visible),
    setSettingVisible: ({ commit }, visible) => commit('SET_SETTINGVISIBLE', visible),
    setDefaultFontFamily: ({ commit }, value) => commit('SET_DEFAULTFONTFAMILY', value),
    setDefaultTheme: ({ commit }, value) => commit('SET_DEFAULT_THEME', value),
    setDefaultFontSize: ({ commit }, value) => commit('SET_DEFAULTFONTSIZE', value),
    setCurrentBook: ({ commit }, value) => commit('SET_CURRENT_BOOK', value),
    setFontFamilyPopupVisible: ({ commit }, value) => commit('SET_FONTFAMILYPOPUPVISIBLE', value),
  }
}

export default book
