Skip to main content

Pythonic Vue.js

Project description


  • changed project style more silimar to vuejs 2.x template
  • use vue file by vbuild


using pip

pip install pyvuejs


start server by file in project directory

python ./

serve configurations

config update by Vue.use in

  • parameters
    • host[str]: host url of server(default: "")
    • port[int]: port number of server(default: 47372)
    • debug[bool]: flag of show bottle log(default: True)
    • open_webbrowser[bool]: flag of open browser when start(default: True)
        host = "",
        port = 47372,
        debug = True,
        open_webbrowser = True

view/component editing guide

same as vue.js, can support by linting

<!-- template block -->
        <label>{{ count }}</label>
            <button style="margin-right:10px;" v-on:click="up_count">up</button>
            <button v-on:click="down_count">down</button>
<!-- style block -->
<style scoped>
button {
    width: 80px;
<!-- script block -->
<script lang="python">
class Component:
    def __init__(self):
        self.count = 0

    def up_count(self):
        self.count += 1

    def down_count(self):
        if self.count > 0:
            self.count -= 1

use view/component

just call name in other view

    <div id="app">
        <div id="nav">
            <router-link to="/Home">Home</router-link> |
            <router-link to="/About">About</router-link> |
            <router-link to="/Counter">Counter</router-link>

events mapping

define map class and map functions in each file of maps

  • if debug option in config, functions can be reached by "GET" and "POST". else, "POST" only
from pyvuejs import VueMap

class Counter(VueMap):
    count = 0
    def get_count(self):
        return self.count
    def up_count(self):
        self.count += 1
    def down_count(self):
        if self.count > 0:
            self.count -= 1


define route path and component in

from pyvuejs import Vue, VueRouter

        "path": "/About",
        "component": "About"
        "path": "/Home",
        "component": "Home"
        "path": "/Counter",
        "component": "Counter"


  • routes


pyvuejs is MIT license

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyvuejs-2.0.5.post3.tar.gz (77.7 kB view hashes)

Uploaded source

Built Distribution

pyvuejs-2.0.5.post3-py3-none-any.whl (79.2 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page