BaseTooltip.vue 424 B

12345678910111213141516171819202122232425262728
  1. <template>
  2. <el-tooltip :content="txt" placement="top">
  3. <span>{{ omitTxt }}</span>
  4. </el-tooltip>
  5. </template>
  6. <script>
  7. export default {
  8. name: 'BaseTooltip',
  9. props: {
  10. txt: {
  11. type: String,
  12. default: ''
  13. }
  14. },
  15. computed: {
  16. omitTxt() {
  17. let str = this.txt;
  18. return str.length > 20 ? str.slice(0, 20) : str;
  19. }
  20. },
  21. methods: {}
  22. };
  23. </script>
  24. <style lang="scss" scoped></style>