這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

SC-Vue

描述

SC-Vue provides a shortcode to inject Vue.js apps
into WordPress pages and posts. For example, the following shortcode
would inject the ‘demo_posts’ app:

  [pl2010_vue app="demo_posts"/]

An app is made up of two files, index.js and index.html. They reside
in a subdirectory bearing the app’s name under the ‘apps’ directory
in the plugin. For the ‘demo_posts’ app, that means:

  • WP_PLUGIN_DIR/sc-vue/apps/demo_posts/index.js
  • WP_PLUGIN_DIR/sc-vue/apps/demo_posts/index.html

The index.js Javascript file sets up an initialization function for
creating a Vue model. That model controls a <div> DOM element that
SC-Vue renders; the content of that <div> comes from index.html.

See apps/demo_01 and apps/demo_02 for simple examples of index.js
and index.html. For a more complex and realistic example that uses
webpack.js to packs Javascript and styles
into a single index.js, see apps/demo_posts. Additional details may
be found in the documentation of the shortcode function in init.php.

安裝

  1. Upload the plugin files to the ‘WP_PLUGIN_DIR/sc-vue’
    directory, or install the plugin through the ‘Plugin’s screen in
    WordPress.
  2. Activate the plugin.
  3. Install any additional Vue app in ‘WP_PLUGIN_DIR/sc-vue/apps’.
    Note that app name must be simple identifier that begins with a letter
    followed by any number of digits, letters, and the underscore.
  4. Startg using shortcode [pl2010_vue app="..."/]!

常見問題

Does this work with WordPress version X?

This plugin is developed on WordPress 5.4. It has not been tried on any
other version.

Does this work with PHP 5.x?

This plugin is developed with PHP 7.x. Backporting to PHP 5.x
should not be difficult however.

評價

2021年9月10日
I have a question, how can we reference a file from the js folder into our index.js file? I want to test some things but I am having this small issue, like how should I type the location for the folder, example: import {fullnames} from './importingVarTest.js'; I still haven't got the hierarchy, it would be great if is possible, if not do I just have to use the index.js file for all the js?
閱讀全部1個評價

貢獻者及開發者

“SC-Vue” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者

將 SC-Vue 外掛本地化為台灣繁體中文版。

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

修改日誌

1.0

  • First version published.