Get started with primeui CDN

Apache-2.0 licensed

Open-source UI library. Build responsive, interactive apps with Vue.js using PrimeUI.

Tags:
  • jquery
  • ui
  • web-components

Stable version

Copied!

How to start using primeui CDN


<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="https://cdn.primefaces.org/primevue/4.1.15/themes/saga-blue/theme.css" />
    <link rel="stylesheet" href="https://cdn.primefaces.org/primevue/4.1.15/components.css" />
    <script src="https://cdn.cdnhub.io/primeui/4.1.15/primeui.min.js"></script>
    <script src="https://cdn.primefaces.org/primevue/4.1.15/primevue.min.js"></script>
    <title>Get started with primeui CDN - cdnhub.io</title>
</head>
<body>
    <div id="app">
        <p>Enter a number:</p>
        <input type="number" v-model="number" class="p-inputtext" />
        <button label="Check Prime" class="p-button-raised" @click="isPrime">Check</button>
        <p v-if="isPrimeResult">{{ number }} is a prime number.</p>
        <p v-else>{{ number }} is not a prime number.</p>
    </div>

    <script>
        new Vue({
            el: '#app',
            data: {
                number: 0,
                isPrimeResult: false
            },
            methods: {
                isPrime() {
                    this.isPrimeResult = this.isPrimeNumber(this.number);
                },
                isPrimeNumber(num) {
                    for (let i = 2; i < num; i++) {
                        if (num % i === 0) {
                            return false;
                        }
                    }
                    return num > 1;
                }
            }
        });
    </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!

All versions