0.1.58 • Published 5 years ago

vue-andy-kurage v0.1.58

Weekly downloads
-
License
MIT
Repository
-
Last release
5 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

5 years ago

0.1.54

5 years ago

0.1.55

5 years ago

0.1.56

5 years ago

0.1.57

5 years ago

0.1.58

5 years ago

0.1.52

5 years ago

0.1.51

5 years ago

0.1.50

5 years ago

0.1.49

5 years ago

0.1.48

5 years ago

0.1.47

5 years ago

0.1.46

5 years ago

0.1.45

5 years ago

0.1.44

5 years ago

0.1.43

5 years ago

0.1.41

5 years ago

0.1.40

5 years ago

0.1.39

5 years ago

0.1.38

5 years ago

0.1.37

5 years ago

0.1.36

5 years ago

0.1.35

5 years ago

0.1.33

5 years ago

0.1.34

5 years ago

0.1.32

5 years ago

0.1.31

5 years ago

0.1.30

5 years ago

0.1.29

5 years ago

0.1.28

5 years ago

0.1.27

5 years ago

0.1.26

5 years ago

0.1.25

5 years ago

0.1.24

5 years ago

0.1.23

6 years ago

0.1.21

6 years ago

0.1.22

6 years ago

0.1.20

6 years ago

0.1.19

6 years ago

0.1.16

6 years ago

0.1.17

6 years ago

0.1.18

6 years ago

0.1.14

6 years ago

0.1.15

6 years ago

0.1.11

6 years ago

0.1.12

6 years ago

0.1.13

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago