Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


  <div id="app">
    <h1>Les permissions</h1>
    <h3>v-if, v-else-if, v-else</h3>
     <!-- Si (if) l'utilisateur a les autorisations par défaut, afficher ce qui suit -->
    <section v-if="userPermission === 'default'">...</section>
    <!-- Sinon et si l'utilisateur a les autorisations administrateur, afficher ce qui suit -->
    <section v-else-if="userPermission === 'admin'">...</section>
    <!-- Si l'utilisateur n'a aucune autorisation afficher ce qui suit -->
    <section v-else>...</section>
    <h1>Ecoutez un evenement</h1>
    <!-- On peut reccourcir v-on:click avec @click -->
     <button v-on:click="alert('Bonjour')">Afficher une alerte</button>
    <h1>Afficher un modal</h1>
        <button @click="showModal = !showModal">Display Modal</button>
    <div v-show="showModal" class="modal">Hello You</div>
    <h1>Les boucles</h1>
    <h2>Shopping Cart</h2>
        <li v-for="item in shoppingCart">
            {{ item.label }} : {{ item.cost }}€
    <p>Pour un totale de : {{ XXXtotalAmount }}€</p>
    <h1>Les attributs dynamics (URL)</h1>
        <li v-for="item in apiResponse">
            <a v-bind:href="item.url">{{ }}</a>
    <h1>Mis jour des donée avec un formulaire</h1>
        <label for="username">Nom d'utilisateur</label>
    <input id="username" type="text" v-model="username" /><br/>
    <label for="pw">Mot de passe</label>
    <input id="pw" type="password" v-model="password" />
  <script src=""></script>

    const app = new Vue({
      el: '#app',
      data: {
        showModal: false,
        shoppingCart: [
                { label: 'Pommes', cost: 6 },
                { label: 'Bananes', cost: 2 },
                { label: 'Noix de coco', cost: 8 }
        apiResponse: [
                { name: 'GitHub', url: '' },
                { name: 'Twitter', url: '' },
                { name: 'Netlify', url: '' }
        username: '',
        password: ''
      computed: {
        totalAmount() {
          return this.Pommes.cost + this.Bananes.cost + this.costOfCoconuts