0.1.58 • Published 4 years ago

vue-andy-kurage v0.1.58

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

vue-andy-kurage

Project setup

npm install vue-andy-kurage

Compiles and hot-reloads for development

npm run serve

Compiles and minifies for production

npm run build-lib

 vue-andy-kurage

Example

main.js

import {AndyKurage} from 'vue-andy-kurage';
Vue.use(AndyKurage);

example.vue

<AndyKurage :script-package="scriptPackage"  :column-width="500" :height="'600px'" />

scriptPackage

{
	"scenario": [],
	"talk_script": {
		"body": [
			{
				"id": "34",
				"text": "title1",
				"type": "node",
				"status": "published",
				"position": 0,
				"items": {
					"scenario_id": ""
				},
				"parent": "#"
			},
			{
				"id": "35",
				"text": "title1-1",
				"type": "node",
				"status": "published",
				"position": 0,
				"items": {
					"scenario_id": ""
				},
				"parent": "34"
			},
			{
				"id": "36",
				"text": "title1-1-1",
				"type": "leaf",
				"position": 0,
				"status": "published",
				"items": {
					"scenario_id": ""
				},
				"questions": [],
				"tags": [],
				"parent": "35"
			},
			{
				"id": "39",
				"text": "title1-2",
				"type": "node",
				"status": "published",
				"position": 1,
				"items": {
					"scenario_id": ""
				},
				"parent": "34"
			},
			{
				"id": "40",
				"text": "title1-2-1",
				"type": "leaf",
				"position": 0,
				"status": "published",
				"items": {
					"scenario_id": ""
				},
				"questions": [],
				"tags": [],
				"parent": "39"
			}
		]
	},
	"synonym_dict": {},
	"inverted_index": {},
	"script_by_id": {},
	"script": []
}

Event

Add param

eventHub

eventHub.ts

import Vue from "vue";

export const eventHub = new Vue();

example.vue

<script>
import { eventHub } from "../eventHub";
...
data: function() {
		return {
			eventHub: eventHub,
...
<template>
...
<AndyKurage :script-package="scriptPackage"  :column-width="500" :height="'600px'" :eventHub="eventHub" />
...

changeRoute

eventBus.$on("changeRoute", ({ routes, index }) => {

})

setScript

click item

eventBus.$on("setScript", item => {})

setResultScript

click result item

eventBus.$on("setResultScript", item => {})

selectScenarioItem

eventBus.$emit(talkScriptId:string, stepIdList:Array<string>)

selectScenarioItemByStepEncoded

eventBus.$emit(talkScriptId:string, stepEncoded:string)

Customize configuration

See Configuration Reference.

0.1.53

4 years ago

0.1.54

4 years ago

0.1.55

4 years ago

0.1.56

4 years ago

0.1.57

4 years ago

0.1.58

4 years ago

0.1.52

4 years ago

0.1.51

4 years ago

0.1.50

4 years ago

0.1.49

4 years ago

0.1.48

4 years ago

0.1.47

4 years ago

0.1.46

4 years ago

0.1.45

4 years ago

0.1.44

4 years ago

0.1.43

4 years ago

0.1.41

4 years ago

0.1.40

4 years ago

0.1.39

4 years ago

0.1.38

4 years ago

0.1.37

4 years ago

0.1.36

4 years ago

0.1.35

4 years ago

0.1.33

4 years ago

0.1.34

4 years ago

0.1.32

4 years ago

0.1.31

4 years ago

0.1.30

4 years ago

0.1.29

4 years ago

0.1.28

4 years ago

0.1.27

4 years ago

0.1.26

4 years ago

0.1.25

4 years ago

0.1.24

4 years ago

0.1.23

4 years ago

0.1.21

4 years ago

0.1.22

4 years ago

0.1.20

4 years ago

0.1.19

4 years ago

0.1.16

4 years ago

0.1.17

4 years ago

0.1.18

4 years ago

0.1.14

4 years ago

0.1.15

4 years ago

0.1.11

4 years ago

0.1.12

4 years ago

0.1.13

4 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago