Title.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <div class="title">
  3. <div class="icon"></div>
  4. <span>{{ title }}</span>
  5. </div>
  6. </template>
  7. <script>
  8. //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  9. export default {
  10. components: {},
  11. props: {
  12. title: {
  13. type: String,
  14. default: '标题',
  15. },
  16. },
  17. data() {
  18. return {
  19. };
  20. },
  21. //监听属性 类似于data概念
  22. computed: {},
  23. //监控data中的数据变化
  24. watch: {},
  25. //方法集合
  26. methods: {},
  27. beforeCreate() { }, //生命周期 - 创建之前
  28. created() { }, //生命周期 - 创建完成(可以访问当前this实例)
  29. beforeMount() { }, //生命周期 - 挂载之前
  30. mounted() { }, //生命周期 - 挂在完成
  31. beforeUpdate() { }, //生命周期 - 更新之前
  32. updated() { }, //生命周期 - 更新之后
  33. beforeDestroy() { }, //生命周期 - 销毁之前
  34. destroy() { },//生命周期 - 销毁完成
  35. activated() { }, //若组件实例是 <KeepAlive> 缓存树的一部分,当组件被插入到 DOM 中时调用。
  36. deactivated() { } //若组件实例是 <KeepAlive> 缓存树的一部分,当组件从 DOM 中被移除时调用。
  37. };
  38. </script>
  39. <style lang="scss" scoped>
  40. .title {
  41. border-width: 0px;
  42. line-height: 3.5vh;
  43. height: 4vh;
  44. background: no-repeat;
  45. background-size: 100%;
  46. background-image: url("/static/images/overview/titlebox.gif");
  47. span {
  48. color: #fff;
  49. font-size: 14px;
  50. font-weight: bold;
  51. margin-left: 3vw;
  52. }
  53. }
  54. </style>