simpleforyou / yii2-and-vue
Yii 2 和 Vue 基础项目模板
1.0.4
2021-12-17 17:09 UTC
Requires
- php: >=7.3.0
- yiisoft/yii2: ~2.0.43
- yiisoft/yii2-swiftmailer: ~2.0.0 || ~2.1.0
Requires (Dev)
- codeception/codeception: ^4.1.23
- codeception/module-asserts: ^1.3.1
- codeception/module-filesystem: ^1.0.3
- codeception/module-yii2: ^1.1.4
- codeception/specify: ~0.4.6
- codeception/verify: ~0.5.0 || ~1.1.0
- symfony/browser-kit: >=2.7 <=4.2.4
- yiisoft/yii2-debug: ~2.1.18
- yiisoft/yii2-faker: ~2.0.5
- yiisoft/yii2-gii: ~2.2.3
- dev-master
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-dependabot/npm_and_yarn/web/vue/json5-and-vue/cli-service-2.2.3
- dev-dependabot/npm_and_yarn/web/vue/express-4.18.2
- dev-dependabot/npm_and_yarn/web/vue/qs-6.5.3
- dev-dependabot/npm_and_yarn/web/vue/decode-uri-component-0.2.2
- dev-dependabot/npm_and_yarn/web/vue/loader-utils-and-vue/cli-service-1.4.2
- dev-dependabot/npm_and_yarn/web/vue/terser-4.8.1
- dev-dependabot/npm_and_yarn/web/vue/eventsource-1.1.1
This package is auto-updated.
Last update: 2024-09-29 05:42:42 UTC
README
您可以使用此模板来创建一个使用 yii2 和 vuejs 的网站。
composer create-project --prefer-dist simpleforyou/yii2-and-vue basic
目录结构
assets/ contains assets definition (NOT NEEDED)
commands/ contains console commands (controllers)
config/ contains application configurations
controllers/ contains Web controller classes
mail/ contains view files for e-mails
models/ contains model classes
runtime/ contains files generated during runtime
tests/ contains various tests for the basic application
vendor/ contains dependent 3rd-party packages
views/ contains view files for the Web application
web/ contains the entry script and Web resurces
src/ contains helper classes
web/vue contains the entry vue script part (Do not upload this folder to your web server)
控制器
控制器现在使用方式有所不同。以前,控制器会渲染页面或模板。现在控制器只返回数据,因为视图已被 Vue 更改。
视图
由于变更,现在只需要两个文件。主要布局和索引页面。在这两个文件中都会调用 VueRenderer,它包含 js 文件和 css 文件。
web/vue
这个文件夹是 Vue 项目。
如何用于生产
-
在
web/vue/package.json中运行构建脚本。构建过程完成后,将在 web 目录下创建一个新的prod文件夹。这个文件夹包含为 Vue 构建的所有文件。 -
将 prod 文件夹上传到您的服务器上的 web 目录。