Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

HTML

              
                <div id="app">
  <v-app>
    <v-content>
      <v-jumbotron color="grey lighten-2" height="auto">
        <v-container fill-height>
          <v-layout align-center>
            <v-flex>
              <h3 class="display-3">Koumoul - Entreprises - Auto complete</h3>
              <p class="subheading">Utilisez simplement notre service pour enrichir vos formulaires avec une recherche sur toutes les entreprises de France.</p>
              <p class="subheading">Cet exemple est construit avec le framework <a href="https://vuejs.org/">vuejs</a> et la librairie d'interface graphique <a href="https://vuetifyjs.com">vuetify</a>. Mais la même logique peut-être appliquée facilement dans un autre cadre.</p>
              <v-btn large color="primary" class="mx-0" href="https://koumoul.com/entreprises">Plus d'information sur le service</v-btn>

            </v-flex>
          </v-layout>
        </v-container>
      </v-jumbotron>
      <v-container>
        <v-select :items="entreprises" v-model="entreprise" item-text="NOMEN_LONG" item-val="SIREN" label="Recherchez une entreprise" autocomplete :loading="loading" cache-items :search-input.sync="search" :error-messages="errorMessages"></v-select>
        <v-text-field label="Identifiant de l'entreprise" :value="entreprise.SIREN" disabled></v-text-field>
        <v-text-field label="Libellé de l'activité de l'entreprise (NAF Niveau 5)" :value="entreprise.naf5enlib" disabled></v-text-field>
      </v-container>
    </v-content>
  </v-app>
</div>
              
            
!

CSS

              
                
              
            
!

JS

              
                new Vue({
  el: "#app",
  data: {
    entreprise: {},
    entreprises: [],
    loading: false,
    search: "",
    errorMessages: []
  },
  watch: {
    search(val) {
      if (!val) return this.entreprises = [];
      this.loading = true;
      this.errorMessages = [];
      this.$http
        .get("https://koumoul.com/s/sirene/api/v1/etablissements", {
          params: {
            q: val, // recherche textuelle simple
            qs: "SIEGE:1", // seulement les sièges sociaux
            size: 10,
            select: "NOMEN_LONG,SIREN,naf5enlib" // quelques champs intéressants, cf https://koumoul.com/s/sirene/schema-doc
          }
        })
        .then(
          res => {
            this.entreprises = res.body.results.map(r => r.doc);
          },
          err => {
            this.errorMessages = [err.bodyText];
          }
        )
        .then(() => {
          this.loading = false;
        });
    }
  }
});

              
            
!
999px

Console