PHPackages                             thefunpower/vue - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. thefunpower/vue

ActiveLibrary

thefunpower/vue
===============

封装VUE是混编PHP代码使用Element UI2.15.13的前提

v2.1.27(1y ago)04254Apache-2.0PHPPHP &gt;=7.1

Since Jan 11Pushed 1y agoCompare

[ Source](https://github.com/thefunpower/vue)[ Packagist](https://packagist.org/packages/thefunpower/vue)[ RSS](/packages/thefunpower-vue/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)DependenciesVersions (33)Used By (4)

vue
===

[](#vue)

初始化
---

[](#初始化)

vue 3

```
$vue =  new Vue;
$vue->version = 3;

```

vue 2

```
$vue =  new Vue;

```

### index

[](#index)

```

```

### 时间区间

[](#时间区间)

```
$vue->search_date = [
  '今天',
  '昨天',
  '本周',
  '上周',
  '上上周',
  '本月',
  '上月',
  '上上月',
  '本年'=>'今年',
  '上年'=>'去年',
  '上上年',
  '最近一个月',
  '最近两个月',

  '最近三个月',
  '第一季度',
  '第二季度',
  '第三季度',
  '第四季度',
];
//限制在这个时间之前的无法选择
$vue->start_date = '2023-11-01';

$vue->add_date();

```

时间定时刷新

```
$vue->loop_picker_options('/product_quality/api_index/date',3);

```

接口返回

```
return json_success(['data'=>(new \Vue)->get_date_area()]);

```

`search_date` 以 `key`=&gt;`value`形式存在，`key`是显示的时间，`value`是显示的标题

```

```

[![演示时间效果](/tests/date1.png "演示时间效果")](/tests/date1.png)

### data

[](#data)

```
$vue->data('text','welcome');

```

### created

[](#created)

```
$vue->created(['load()']);
$vue->method('load()',"

");

```

### mounted

[](#mounted)

```
$vue->mounted("a","
  alert(2);
")

```

其中`a`是`key`

### watch

[](#watch)

```
$vue->watch("page(new_val,old_val)","
  console.log('watch');
  console.log(old_val);
  console.log(new_val);
")

```

```
$vue->watch("where.per_page","
  handler(new_val,old_val){
    console.log('watch');
    console.log(old_val);
    console.log(new_val);
  },
");

```

```
$vue->watch("where","
  handler(new_val,old_val){
    console.log('watch');
    console.log(old_val.per_page);
    console.log(new_val.per_page);
  },
  deep: true
");

```

底部加入

```

```

wangeditor 富文本
==============

[](#wangeditor-富文本)

如`body`字段

在html中

```

```

vue代码

```
$vue->editor_method();
$vue->method("edit_form(row)","
    let f = this.field;
    this.form = {};
    for(let r of this.field){
        this.\$set(this.form,r,row[r]);
    }
    this.is_open = true;
".$vue->load_editor_edit());

```

压缩JS
====

[](#压缩js)

安装

```
yarn add --dev javascript-obfuscator

```

配置

```
$config['vue_encodejs'] = true;
$config['vue_encodejs_ignore'] = ['/plugins/config/config.php'];

```

### 一般函数

[](#一般函数)

每个季度开始、结束时间

```
vue_get_jidu_array($year)

```

某月的最后一天

```
vue_get_last_day($month = '2023-07')

```

### wangeditor 5

[](#wangeditor-5)

有时需要替换原来的图片上传按钮，以下为演示，实际使用请根据情况处理。

```
$vue->data('is_open_editor',false);
$vue->editor_image_upload_click = "
    app.add_media('editorbody');
    app.is_open_editor = true;
";

```

### 导入文件

[](#导入文件)

```
$import = $vue->get_import([
    'js'=>" alert('导入成功');";
    'upload_url'=>'/sys/upload/one',
    'parse_url'=>'/product_quality/goods/import_parse',
    'save_url'=>'/product_quality/goods/import_parse_save',
    'label'=>'导入xls',
    'table_body'=>'

                可导入

    '
]);

```

返回 `html` `pop_html`

```

```

接口处理 import\_parse

```
  $url = $this->input['url'];
  $file = PATH.$url;
  if(!file_exists($file)){
    return json_error(['msg'=>'操作异常']);
  }
  $all = \helper_v3\Xls::load($file,[
        '产品名称'   => 'desc',
        '规格型号'   => 'spec',
        '批号'       => 'product_ph',
        '生产日期'   => 'produce_date',
        '失效日期'   => 'invalid_date',
        '唯一码'     => 'uuid',
        '注册证号'     => 'reg_num',
  ]);
  foreach($all as $k=>$v){
  }
  if(!$all){
    return json_error(['msg'=>'导入的文件数据异常']);
  }
  foreach($all as $k=>&$v){

  if($res){
    $err[] = "唯一码已存在";
  }
  $v['is_err'] = false;
  if($err){
    $v['err'] = implode("",$err);
    $v['is_err'] = true;
  }
}
if($all){
  $all = array_values($all);
}
return json_success(['data'=>$all]);

```

### 开源协议

[](#开源协议)

[Apache License 2.0](LICENSE)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance43

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~23 days

Recently: every ~40 days

Total

32

Last Release

478d ago

Major Versions

v1.0.2 → v2.0.12023-02-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/c6f09836c59d691e60dd442ee29a2b6673d2c8c319b248aedcde7103f17201e1?d=identicon)[sunkangchina2022](/maintainers/sunkangchina2022)

---

Top Contributors

[![sunkangchina](https://avatars.githubusercontent.com/u/66815206?v=4)](https://github.com/sunkangchina "sunkangchina (7 commits)")

---

Tags

php

### Embed Badge

![Health badge](/badges/thefunpower-vue/health.svg)

```
[![Health](https://phpackages.com/badges/thefunpower-vue/health.svg)](https://phpackages.com/packages/thefunpower-vue)
```

###  Alternatives

[pestphp/pest-plugin-stressless

Stressless plugin for Pest

67792.6k16](/packages/pestphp-pest-plugin-stressless)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
