0.0.4 • Published 2 years ago
binary-decision-tree-list v0.0.4
Test Demo
this is a test!
A package used to display a list with route condition of the decision tree
Installation
$ npm i binary-decision-tree-list
Quick start
<script setup>
import DecisionTree from './components/DecisionTree.vue'
const toggle = ref(true)
function clickHandle(node, event) {
console.log(node, event)
}
const data = reactive([
{
conclusion: false,
text: 'test1',
click: clickHandle
}
])
function addItem() {
data.push({
conclusion: !Math.round(Math.random()),
text: 'test'+ (data.length + 1),
click: clickHandle
})
console.log(data)
}
</script>
<template>
<button @click="addItem">add</button>
<button @click="toggle = !toggle">toggle</button>
<div class="container">
<DecisionTree :list="data" :show-diag="toggle" corr-color="#5ff" fail-color="#b6f"/>
</div>
<template>