1.1.1 • Published 3 years ago

vue-beginner-guide v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Novice boot component

Install

npm install vue-beginner-guide -S
import Guide from 'vue-beginner-guide';
Vue.component('Guide', Guide);

Params

AttributeExplanationTypeDefault
showControl the display of novice bootBooleanfalse
configContent configuration, each array entry is a step in the boot, as followsArray[]

The config sample

config: [{
    dom: 'block1',// Box selection element, DOM node or ID name
    title: 'Step 1 Title',// Description copy title
    cont: ['1.This is the first paragraph', '2.This is the second paragraph'],// State the content of the copy, each item is a paragraph
    btnText: { // Action buttons
        pre: 'previous',// Previous button copy
        next: 'next',// Next button copywriting
        close: 'close'// Close button copywriting
    },

    width: 200, // Optional:You can customize the width of the box area. When not specified, the component automatically takes the width of the target element
    height: 100, // Optional:The box area defines the height. If this is not specified, the component automatically takes the width of the target element

    fakeImg: './image.png' // Optional:Overwrite the image of the target element, if you want to replace the element to be illustrated with a picture.
},
{
    //... Step 2
}]

Events

The event nameinstructionsThe return value
before-nextClick the Next button to switch before triggeringpreIndex & nextIndex:Index before and after the switch; preConfig & nextConfig: The configuration before and after the switch
after-nextClick the next button to trigger the switchpreIndex & nextIndex:Index before and after the switch; preConfig & nextConfig: The configuration before and after the switch
before-backClick the previous button to switch before triggeringpreIndex & nextIndex:Index before and after the switch; preConfig & nextConfig: The configuration before and after the switch
after-backClick the previous button to trigger the switchpreIndex & nextIndex:Index before and after the switch; preConfig & nextConfig: The configuration before and after the switch
closeClick the close button to triggerindex: The sequence number of the step when closing; curConfig:Step configuration when closing

新手引导组件

引入

npm install vue-beginner-guide -S
import Guide from 'vue-beginner-guide';

Vue.component('Guide', Guide);

参数

属性解释类型默认
show控制新手引导的展示Booleanfalse
config内容配置,每一个数组项是引导中的一步,具体配置如下Array[]

config配置内容示例

config: [{
    dom: 'block1', //框选元素,dom节点或id名
    title: '第一步标题', //说明文案标题
    cont: ['1.这是第一段文案', '2.这是第二段文案'], //说明文案内容,每一项是一段
    btnText: { //操作按钮
        pre: '上一步', // 上一步按钮文案
        next: '下一步', // 下一步按钮文案
        close: '关闭' // 关闭引导按钮文案
    },

    width: 200, //(可选)框选区域自定义宽度,当不指定时,组件自动取目标元素的宽度
    height: 100, //(可选)框选区域自定义高度,当不指定时,组件自动取目标元素的高度

    fakeImg: './image.png' //(可选)覆盖目标元素的图片(如果想用一张图片替代要说明的元素时)
},
{
    //... 第二步
}]

事件

事件名说明返回值
before-next点击下一步按钮,切换之前触发preIndex 和 nextIndex:切换前后的index;preConfig 和 nextConfig:切换前后步骤的配置
after-next点击下一步按钮,切换之后触发preIndex 和 nextIndex:切换前后的index;preConfig 和 nextConfig:切换前后步骤的配置
before-back点击上一步按钮,切换之前触发preIndex 和 nextIndex:切换前后的index;preConfig 和 nextConfig:切换前后步骤的配置
after-back点击上一步按钮,切换之后触发preIndex 和 nextIndex:切换前后的index;preConfig 和 nextConfig:切换前后步骤的配置
close点击关闭按钮触发index: 关闭时的步骤序号;curConfig:关闭时的步骤的配置
1.1.1

3 years ago

1.1.0

3 years ago

1.0.22

3 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.11

3 years ago

1.0.21

3 years ago

1.0.10

3 years ago

1.0.20

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago