index.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <!-- 编辑器-基础 -->
  3. <div>
  4. <toolbar v-if="info"></toolbar>
  5. </div>
  6. </template>
  7. <script>
  8. import Toolbar from "./Toolbar";
  9. import { mapGetters } from "vuex";
  10. import { getWorkInfo } from "@/api";
  11. export default {
  12. name: "EditorBase",
  13. components: {
  14. Toolbar,
  15. },
  16. data() {
  17. return {
  18. isInit: false,
  19. };
  20. },
  21. computed: {
  22. ...mapGetters({
  23. // info: "info",
  24. info: "base/baseInfo",
  25. }),
  26. },
  27. watch: {
  28. // info: {
  29. // handler(newVal, oldVal) {
  30. // if (newVal && !this.isInit) {
  31. // this.isInit = true;
  32. // this.getSettingsInfo();
  33. // }
  34. // },
  35. // },
  36. },
  37. methods: {
  38. getSettingsInfo() {
  39. // this.$store.commit("base/setData", this.info);
  40. getWorkInfo(
  41. {},
  42. (res) => {
  43. let data = res.data;
  44. this.$store.commit("base/setData", data);
  45. },
  46. () => {}
  47. );
  48. },
  49. },
  50. mounted() {
  51. this.getSettingsInfo();
  52. },
  53. };
  54. </script>
  55. <style lang="less">
  56. input::placeholder,
  57. textarea::placeholder {
  58. font-size: 14px;
  59. color: #505050 !important;
  60. }
  61. </style>