Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@fattypanda/vue-treeselect
Advanced tools
A multi-select component with nested options support for Vue.js
npm install --save @fattypanda/vue-treeselect
基本文档请参考 https://vue-treeselect.js.org/
自定义渲染前方箭头
类型function
,默认值void 0
,优先级大于slot['arrow-icon']
;
参数:
<template>
<div id="app">
<TreeSelect
v-model="value"
:options="options"
:render-arrow-icon="({ shouldExpand, h }) => {
return h('div', shouldExpand ? '-' : '+')
}"
/>
</div>
</template>
<script>
// import the component
import TreeSelect from '@fattypanda/vue-treeselect'
// import the styles
import '@fattypanda/vue-treeselect/dist/vue-treeselect.css'
export default {
// register the component
components: { TreeSelect },
data() {
return {
// define the default value
value: null,
// define options
options: [ {
id: 'a',
label: 'a',
children: [ {
id: 'aa',
label: 'aa',
}, {
id: 'ab',
label: 'ab',
} ],
}, {
id: 'b',
label: 'b',
}, {
id: 'c',
label: 'c',
} ],
}
},
}
</script>
自定义渲染OptionLabel
类型function
,默认值void 0
,优先级大于slot['option-label']
;
参数:
<template>
<div id="app">
<TreeSelect
v-model="value"
:options="options"
:render-option-label="({ labelClassName, countClassName, node, shouldShowCount, count, h }) => {
return h('div', { class: labelClassName, attrs: { title: node.label } }, [
node.label,
shouldShowCount ? h('span', { class: countClassName }, `(${count})`) : void 0,
])
}"
/>
</div>
</template>
<script>
// import the component
import TreeSelect from '@fattypanda/vue-treeselect'
// import the styles
import '@fattypanda/vue-treeselect/dist/vue-treeselect.css'
export default {
// register the component
components: { TreeSelect },
data() {
return {
// define the default value
value: null,
// define options
options: [ {
id: 'a',
label: 'a',
children: [ {
id: 'aa',
label: 'aa',
}, {
id: 'ab',
label: 'ab',
} ],
}, {
id: 'b',
label: 'b',
}, {
id: 'c',
label: 'c',
} ],
}
},
}
</script>
自定义渲染前方箭头,scope
为节点vue
组件对象,优先级小于props.renderArrowIcon
;
<template>
<div id="app">
<TreeSelect v-model="value" :options="options" >
<template slot="arrow-icon" slot-scope="{shouldExpand}">
<div>{{shouldExpand? '-': '+'}}</div>
</template>
</TreeSelect>
</div>
</template>
<script>
// import the component
import TreeSelect from '@fattypanda/vue-treeselect'
// import the styles
import '@fattypanda/vue-treeselect/dist/vue-treeselect.css'
export default {
// register the component
components: { TreeSelect },
data() {
return {
// define the default value
value: null,
// define options
options: [ {
id: 'a',
label: 'a',
children: [ {
id: 'aa',
label: 'aa',
}, {
id: 'ab',
label: 'ab',
} ],
}, {
id: 'b',
label: 'b',
}, {
id: 'c',
label: 'c',
} ],
}
},
}
</script>
2020-07-15:
修改Treeselect
组件
renderOptionLabel
参数;修改Option
组件的renderLabel
函数
Treeselect
组件获取renderOptionLabel
渲染组件(保留了原本的slots['option-label']方式
);<label class={labelClassName}>
修改为<label class={labelClassName} title={node.label}>
2020-07-14:
修改Treeselect
组件
renderArrowIcon
参数;slots['arrow-icon']'
;修改Option
组件的renderArrow
函数
Treeselect
组件获取renderArrowIcon
、slots['arrow-icon']'
渲染组件;FAQs
A multi-select component with nested options support for Vue.js
The npm package @fattypanda/vue-treeselect receives a total of 0 weekly downloads. As such, @fattypanda/vue-treeselect popularity was classified as not popular.
We found that @fattypanda/vue-treeselect demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.