npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@alchemy_cms/vue

v0.10.0

Published

AlchemyCMS mixins for VueJS

Downloads

25

Readme

AlchemyCMS mixins for VueJS

Build Status npm version

VueJS mixins for rendering content from AlchemyCMS

Install

yarn add @alchemy_cms/vue

Usage

In a page component

import { AlchemyPage } from "@alchemy_cms/vue"

export default {
  mixins: [AlchemyPage],
}

You now have acces to the page prop and its elements. Also you have access to the componentName() method that you can use to dynamically render element components.

<template>
  <div :class="page.page_layout">
    <component
      :is="componentName(element)"
      v-for="element in page.elements"
      :key="element.id"
      :element="element"
    />
  </div>
</template>

<script>
  import { AlchemyPage } from "@alchemy_cms/vue"
  import MainHeader from "~/alchemy/elements/main_header"
  import TextBlock from "~/alchemy/elements/text_block"

  export default {
    components: {
      main_header: MainHeader,
      text_block: TextBlock,
    },
    mixins: [AlchemyPage],
  }
</script>

Note you need to pass the data into the components page prop either by fetching it from the Alchemy API or by erb interpolation.

In an element component

import { AlchemyElement } from "@alchemy_cms/vue"

export default {
  mixins: [AlchemyElement],
}

With this mixin you have acces to the element prop and its ingredients.

Also you have access to the getIngredient() and getEssence() methods that you can use to pass content from Alchemy objects into your components props.

<template>
  <Container>
    <Image :src="imageUrl" :alt="imageAlt" />
    <Paragraph class="text" v-html="text" />
  </Container>
</template>

<script>
  import { AlchemyElement } from "@alchemy_cms/vue"
  import Container from "~/components/Container"
  import Image from "~/components/Image"
  import Paragraph from "~/components/Paragraph"

  export default {
    components: { Container, Image, Paragraph },
    mixins: [AlchemyElement],
    computed: {
      imageUrl() {
        return this.getIngredient("picture")
      },
      altText() {
        return this.getEssence("picture")?.alt_text
      },
      text() {
        return this.getIngredient("text")
      },
    },
  }
</script>

Note you need to pass the data into the components element prop either by fetching it from the Alchemy API, by passing it from a page component (see example above) or by erb interpolation.

camelCase attributes

This package supports camelCase attributes as well was under_score attributes.