• L8_906873
  • 226.2KB
  • zip
  • 0
  • VIP专享
  • 0
  • 2022-05-22 05:59
    上传日期 在纯Python中使用 vue.py提供了Python绑定 。 它使用在浏览器中运行Python。 这是vue.py组件的一个简单示例 from browser import alert from vue import VueComponent class HelloVuePy ( VueComponent ): greeting = "Hello" def greet ( self , event ): alert ( self . greeting ) template = """ <button @clic
# [![Build Status](]( [![PyPI](]( [![License](](LICENSE) use [Vue.js]( with pure Python provides Python bindings for [Vue.js]( It uses [brython]( to run Python in the browser. Here is a simple example of an component ```python from browser import alert from vue import VueComponent class HelloVuePy(VueComponent): greeting = "Hello" def greet(self, event): alert(self.greeting) template = """ <button @click="greet">click me</button> """ HelloVuePy("#app") ``` ## Installation ```bash $ pip install vuepy ``` ## Development Status The goal is to provide a solution to write fully-featured Vue applications in pure Python. To get an overview what currently is supported, have a look at the [Documentation]( Have a look [here]( to see whats planned! See also the [Limitations]( ## Documentation Documentation is available [here]( Examples can be found [here]( These are versions of the [Vue.js examples]( ## Performance Initial loading times of `` apps can be very long. Especially when loading a lot of python files. Still figuring out how to solve this. Have not done any peformance tests, but havent noticed any issues with performance as soon as the app was fully loaded. ## Development ### Getting Started Open in []( Get the code ```bash $ git clone $ cd ``` Optionally you can create a [venv]( ```bash $ python -m venv venv $ source venv/bin/activate ``` Install required python packages, the chromedriver for selenium and brython ```bash $ make env.up ``` Format the code ```bash $ make format ``` Run tests ```bash $ make tests # runs all tets $ make tests.unit # runs unit tests $ make tests.selenium # runs selenium tests $ make tests.cli # runs cli tests $ make tests TEST=cli/ # run explicit test ``` Run an example ```bash $ make run APP=examples/tree_view # makes example available on port 5000 ``` Clean up your working directory. ```bash $ make env.clean ``` Reset your development environment _(clean up, reinstall packages and redownload needed files)_ ```bash $ make env.down $ make env.up ``` Publish a new release ```bash $ make release # bumps minor version number $ make release MODE=major # bumps major version number $ make release MODE=patch # bumps patch number ``` ### Contributing see [CONTRIBUTING](CONTRIBUTING) ### Workflow Development happens on the [master branch]( This also means the latest documentation can be found [here]( The [release branch]( should always be even with the latest release. Changes to this branch also trigger a update of gh-pages. Therefor fixes to the documentation can be made on the release branch. So that the [documentation]( is always valid for the latest release. ## License This project is licensed under the MIT License - see the [LICENSE]( file for details