Only supports HBuilderX 1.9.0+

What is Vue Doc ?

It can be understood as vue component instructions.

When using components in other files, a code prompt will pop up.

What is a component? Components are reusable Vue instances with a name.

Syntax

Mainly used in the script part, it needs to be written on the export default

  1. /**
  2. * Here is a component description, which will be displayed when the label is prompted
  3. * @description Here is also a component description
  4. * @tutorial https://uniapp.dcloud.io/api/media/image?id=chooseimage
  5. * @property {String} type = [button|input|...] attribute description
  6. * @event {Function} tap Event description
  7. * @example Sample code
  8. */

Among them, the type between the @property and @event { } is the type, and the type of event must be Function.

Example

  1. <script>
  2. /**
  3. * Page turning component
  4. * @description Page turning component
  5. * @tutorial http://www.baidu.com
  6. * @property {Number} total Total number of page data
  7. * @property {String} size = [big|small] Component size
  8. * @event {Function} close Close event
  9. * @example <Pagination @total="50" @close=""></Pagination>
  10. */
  11. export default {
  12. props: {
  13. "total": Number,
  14. "size": String
  15. },
  16. data () {
  17. return {
  18. pageSize: 10,
  19. pageNumber: 0
  20. }
  21. },
  22. methods: {
  23. handleChange(data, event) {
  24. this.$emit('PsPn', this.pageSize, this.pageNumber)
  25. }
  26. }
  27. }
  28. </script>

Component tips:

What is Vue Doc ? - 图1

What is Vue Doc ? - 图2

Attribute hints:

What is Vue Doc ? - 图3

Event reminder:

What is Vue Doc ? - 图4