1.0.6 • Published 3 years ago

render-html-js v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

中文 | English

html-render-js

利用JS生成常用的一些html元素 请使用最新版本!!!

支持列表

Radio, Checkbox, Input, Textarea

安装

一、使用Npm

npm i render-html-js --save

二、直接引入dist文件下中的 index.umd.js文件

例子

    const radioParams = {
        title: '第一个title',
        type: 'radio',
        name: 'sex',
        className: 'radio-clsss',
        list: [
            { value:'男', class: 'test', label:'男',  className: 'radio-1 hojj'},
            { value:'女', class: 'test', label:'女', id:"my-id2", className: 'radio-2'},
            { value:'你猜', class: 'test', label:'哈哈', id:"my-id3"},
        ]
    }

    const checkboxParams = {
        title: '第三个title',
        type: 'checkbox',
        name: 'hobby',
        className: 'checkbox-clsss',
        list: [
            { value:'10', class: 'test', label:'10',  className: 'checkbox-1 hojj'},
            { value:'8', class: 'test', label:'8', className: 'checkbox-2'},
            { value:'5', class: 'test', label:'5'},
        ]
    }

    const inputParams = {
        title: '第三个title',
        type: 'input',
        name: 'name',
        id: 'name',
        value: '',
        className: 'input-clsss',
    }

    const textareaParams = {
        title: '简介',
        type: 'textarea',
        name: 'desc',
        id: '',
        value: '默认简介……',
        className: 'textarea-clsss',
    }

    const arr = [radioParams, checkboxParams, inputParams, textareaParams]
    const res = HtmlRender.render(arr)
    console.log(res);

License

MIT

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago