svelte-copyright - A Svelte component to format and display a copyright notice.

栏目: IT技术 · 发布时间: 5年前

内容简介:AThis package is available on NPM, and you can install it with

svelte-copyright

© A Svelte component to format and display a copyright notice.

A Svelte component to format and display a copyright notice.

Try me on CodeSandbox!

Installation

This package is available on NPM, and you can install it with npm or yarn :

npm install svelte-copyright

yarn add svelte-copyright

Usage

Import the Copyright component and use it in your Svelte project.

<script>
  import Copyright from 'svelte-copyright';
</script>

<footer>
  <Copyright>
    Dave Lunny
  </Copyright>
</footer>

This will output HTML which looks something like this:

<footer>
  <span>© Copyright 2020 Dave Lunny</span>
</footer>

Props

All props are optional (as they all have default values).

Prop Possible Values Default Value Description
date RFC2822/ISO8601 date string Date.now() Date for the copyright year.
format 'numeric' | '2-digit' 'numeric' Format for the copyright year.
position 'pre' | 'post' 'pre' Position of the Copyright relative to the contents you provide.

Additional Props

Note that any additonal props will be spread onto the component. This allows you to do things like provide a custom class name to your component.

<Copyright>
  Dave Lunny
</Copyright>

<style>
  :global(.custom-copyright) {
    color: lime;
  }
</style>

Contributing

Feel free to file an issue or open a pull request. Ensure that you add tests for any new functionality.

Inspiration

This was inspired by react-copyright by Jason Bellamy .

:v: Built by Dave Lunny .


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

另一个地球

另一个地球

[美]马克·格雷厄姆、威廉·H·达顿 / 胡泳、徐嫩羽 / 电子工业出版社 / 2015-10-1 / 78

互联网在日常工作和生活中扮演日益重要的角色,互联网将如何重塑社会?本书通过汇集有关互联网文化、经济、政治角色等问题的研究成果,提供了特定社会制度背景下解决这一问题的根本办法。 关于互联网的研究是蓬勃发展的崭新领域,牛津大学互联网研究院(OII)作为创新型的跨学科学院,自成立起就专注于互联网研究。牛津大学互联网研究院关于互联网+社会的系列讲座在一定程度上塑造了互联网+社会。本书内容基于不同学科......一起来看看 《另一个地球》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

SHA 加密
SHA 加密

SHA 加密工具