0.0.4 • Published 2 years ago

binary-decision-tree-list v0.0.4

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

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>
0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago