Documentation

Vue
in package

用于生成vue2或vue3的JS代码

Table of Contents

Properties

$_editor  : mixed
生成编辑器HTML
$add_method  : mixed
$add_url  : mixed
$after_save  : mixed
$create_update_load  : mixed
$created_js  : mixed
$data  : mixed
$data_form  : mixed
$edit_method  : mixed
$edit_url  : mixed
$editor_timeout  : mixed
$encodejs  : mixed
$id  : mixed
$load_name  : mixed
$methods  : mixed
$mounted  : mixed
$opt  : mixed
$opt_data  : mixed
$opt_method  : mixed
$page_data  : mixed
$page_method  : mixed
$page_url  : mixed
$reset_method  : mixed
$search_date  : mixed
$start_date  : mixed
$tree_field  : mixed
$tree_method  : mixed
$upload_url  : mixed
$use_config  : mixed
$version  : mixed
vue版本,默认为2 当为3时,请加载vue3的JS,如 https://unpkg.com/vue@3/dist/vue.global.js
$watch  : mixed

Methods

__construct()  : mixed
construct
add_date()  : mixed
日期区间: <el-date-picker @change="reload" v-model="where.date" value-format="yyyy-MM-dd" :picker-options="pickerOptions" size="medium" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"> </el-date-picker>
addDateTimeSelect()  : mixed
afterSave()  : mixed
created()  : mixed
支持created(['load()'])
crud()  : mixed
支持crud
data()  : mixed
定义data $vue->data("object","js:{}"); $vue->data("arr","[]"); $vue->data("aa",500); $vue->data("bb",' { s:1, ss:3 } '); $vue->data("true",true); $vue->data("false",false); $vue->data("json",json_encode(['a'=>1])); $vue->data("json1",['a','b']);
data_form()  : mixed
form字段
editor()  : mixed
editor_method()  : mixed
编辑器
init()  : mixed
init
load_editor()  : mixed
加载wangeditor
load_editor_add()  : mixed
添加
load_editor_edit()  : mixed
更新
method()  : mixed
支持method
mounted()  : mixed
$vue->mounted('',"js: const that = this window.onresize = () => { return (() => { that.height = that.\$refs.tableCot.offsetHeight; })() } ");
pager()  : mixed
输出element el-pager
reset_date()  : mixed
重置时间字段
run()  : mixed
生成vue js代码
sort()  : mixed
排序 misc('sortable'); $vue->sort(".sortable1 tbody","_this.form.xcx_banner");
watch()  : mixed
支持watch
get_date_area()  : mixed
设置时间选择区间
get_date_range_flag()  : mixed
parse_data()  : mixed
解析data
parse_v()  : mixed
解析value

Properties

$_editor

生成编辑器HTML

public static mixed $_editor

$add_method

public mixed $add_method = ''

$add_url

public mixed $add_url

$after_save

public mixed $after_save = []

$create_update_load

public mixed $create_update_load = []

$created_js

public mixed $created_js = []

$data

public mixed $data = ["is_show" => \false, 'where' => "{per_page:20}", 'lists' => "[]", 'page' => "1", 'total' => 0, 'form' => "{}", 'node' => "{}", 'row' => "{}", 'loading' => \true]

$data_form

public mixed $data_form

$edit_method

public mixed $edit_method = ''

$edit_url

public mixed $edit_url

$editor_timeout

public mixed $editor_timeout = 600

$encodejs

public mixed $encodejs = \false

$id

public mixed $id = "#app"

$load_name

public mixed $load_name = "load"

$methods

public mixed $methods = []

$mounted

public mixed $mounted = []

$opt

public mixed $opt = ['is_editor' => \false, 'is_page' => \false, 'is_reset' => \false, 'is_add' => \false, 'is_edit' => \false, 'is_tree' => \false]

$opt_data

public mixed $opt_data = ['is_page' => 'page_data']

$opt_method

public mixed $opt_method = ['is_page' => 'page_method', 'is_reset' => 'reset_method', 'is_add' => 'add_method', 'is_edit' => 'edit_method', 'is_tree' => 'tree_method', 'is_editor' => 'editor_method']

$page_data

public mixed $page_data = ["is_show" => \false, 'where' => "{per_page:20}", 'lists' => "[]", 'page' => "1", 'total' => 0, 'form' => "js:{}", 'node' => "js:{}", 'res' => "js:{}", 'loading' => \true]

$page_method

public mixed $page_method = ['page_size_change(val)' => "this.where.page= 1;this.where.per_page = val;this.load();", 'page_change(val)' => "this.where.page = val;this.load();"]

$page_url

public mixed $page_url

$reset_method

public mixed $reset_method = ['reload()' => "this.where.page = 1;this.loading=true;this.load();", 'reset()' => "this.where = {};this.loading=true;this.load();"]

$search_date

public mixed $search_date = []

$start_date

public mixed $start_date = ''

$tree_field

public mixed $tree_field = 'pid'

$tree_method

public mixed $tree_method = ['select_click(data)' => " \n this.node = data;\n this.form.pid = data.id;\n this.form._pid_name = data.label;\n this.\$refs['pid'].\$el.click();\n "]

$upload_url

public mixed $upload_url = '/admin/upload/index'

$use_config

public mixed $use_config = \true

$version

vue版本,默认为2 当为3时,请加载vue3的JS,如 https://unpkg.com/vue@3/dist/vue.global.js

public mixed $version = 2

$watch

public mixed $watch = []

Methods

__construct()

construct

public __construct() : mixed

add_date()

日期区间: <el-date-picker @change="reload" v-model="where.date" value-format="yyyy-MM-dd" :picker-options="pickerOptions" size="medium" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"> </el-date-picker>

public add_date() : mixed

$date = g('date'); if ($date[0]) { $where['created_at[>]'] = date("Y-m-d 00:00:00", strtotime($date[0])); } if ($date[1]) { $where['created_at[<=]'] = date("Y-m-d 23:59:59", strtotime($date[1])); }

addDateTimeSelect()

public addDateTimeSelect() : mixed

afterSave()

public afterSave(mixed $val) : mixed
Parameters
$val : mixed

created()

支持created(['load()'])

public created(mixed $methods) : mixed
Parameters
$methods : mixed

crud()

支持crud

public crud() : mixed

data()

定义data $vue->data("object","js:{}"); $vue->data("arr","[]"); $vue->data("aa",500); $vue->data("bb",' { s:1, ss:3 } '); $vue->data("true",true); $vue->data("false",false); $vue->data("json",json_encode(['a'=>1])); $vue->data("json1",['a','b']);

public data(mixed $key, mixed $val) : mixed
Parameters
$key : mixed
$val : mixed

data_form()

form字段

public data_form(mixed $key, mixed $val) : mixed
Parameters
$key : mixed
$val : mixed

editor()

public editor([mixed $name = 'body' ]) : mixed
Parameters
$name : mixed = 'body'

editor_method()

编辑器

public editor_method() : mixed

init()

init

public init() : mixed

load_editor()

加载wangeditor

public load_editor() : mixed

load_editor_add()

添加

public load_editor_add() : mixed

load_editor_edit()

更新

public load_editor_edit() : mixed

method()

支持method

public method(mixed $name, mixed $val) : mixed
Parameters
$name : mixed
$val : mixed

mounted()

$vue->mounted('',"js: const that = this window.onresize = () => { return (() => { that.height = that.\$refs.tableCot.offsetHeight; })() } ");

public mounted(mixed $name, mixed $val) : mixed
Parameters
$name : mixed
$val : mixed

pager()

输出element el-pager

public pager([mixed $load = 'load' ][, mixed $where = 'where' ][, mixed $arr = [] ]) : mixed
Parameters
$load : mixed = 'load'

load或load()

$where : mixed = 'where'

分页传参数

$arr : mixed = []

el-pager参数 ['@size-change'=>'',':page-sizes']

reset_date()

重置时间字段

public reset_date() : mixed

run()

生成vue js代码

public run() : mixed

sort()

排序 misc('sortable'); $vue->sort(".sortable1 tbody","_this.form.xcx_banner");

public sort(mixed $element[, mixed $change_obj = 'lists_sort' ][, mixed $options = [] ]) : mixed
Parameters
$element : mixed
$change_obj : mixed = 'lists_sort'
$options : mixed = []

watch()

支持watch

public watch(mixed $name, mixed $val) : mixed
Parameters
$name : mixed
$val : mixed

get_date_area()

设置时间选择区间

protected get_date_area() : mixed

get_date_range_flag()

protected get_date_range_flag(mixed $a, mixed $b, mixed $allow_1) : mixed
Parameters
$a : mixed
$b : mixed
$allow_1 : mixed

parse_data()

解析data

protected parse_data(mixed $val) : mixed
Parameters
$val : mixed

parse_v()

解析value

protected parse_v(mixed &$k, mixed &$v) : mixed
Parameters
$k : mixed
$v : mixed

        
On this page

Search results